サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
画力アップ
cjohansen.no
¶Clojure to die forThere are many reasons to love Clojure; homoiconicity, persistent data structures, macros, and the list goes on. In this post, I want to focus on a few "details" in the language that really puts the icing on the cake, and clears up many common situations for me. Published March 11 2014 ¶Map accessIn Clojure, you can access map entries in a number of useful ways. First, a map can
A simple function function add(a, b) { return a + b; } Higher-order functions function makeAdder(base) { return function (num) { return base + num; }; }
Sinon.JS 0.6.0 - Fake XMLHttpRequest and improved test framework integration Sinon.JS 0.6.0 is out and it features a new FakeXMLHttpRequest object and a high-level interface for testing xhr-dependent code along with improvements to sinon.sandbox and sinon.test. Warning: Slightly long, but thorough post. Short version is in the currently basic API docs. Testing "Ajax" Code Sinon.JS 0.6.0 sets out t
Stateless, data-driven UIsA practical example of how to write stateless, data-driven UIs September 17 2023ClojureScript, Frontend Partitioning dataFunctions like map, filter, and reduce are useful tools that many developers keep in their toolbox. partition may not be as commonly known, but in this post I'll show you why it should be. December 21 2020Clojure, Functional programming Proper URLs for
Date#strftime var date = new Date(2011, 5, 29); date.strftime("%Y-%m-%d"); "2011-06-29" Problems ahead var date = new Date(2009, 11, 5); date.strftime("%Y"); //=> "2009" date.strftime("%m"); //=> "12" date.strftime("%d"); //=> "05" date.strftime("%y"); //=> "9" Test setup <!DOCTYPE html> <html> <head> <title>Date.prototype.strftime test</title> </head> <body> <script type="text/javascript" src="st
http://sinonjs.org http://www.opensource.org/licenses/bsd-license.php
Multi-staging environment for Rails using Capistrano and mod_rails I've finally gotten around to checking out mod_rails. As it turns out, it was every bit as simple and impressing as I had suspected. Here's how I set up a multi-staging environment using mod_rails and Capistrano. Phusion passenger (aka mod_rails) Setting up passenger is dead simple, as explained on Phusion's installation page: sudo
In addition to low-level tools for stubbing and mocking and high-level tools to integrate with test runners, Sinon provides a few useful utilities. This post explains the first of these, which is fake timers and Dates. Testing time Client-side JavaScript frequently utilizes setTimeout, clearTimeout, setInterval and clearInterval to defer execution. When testing code that depends on these functions
Since my talk at Front-Trends in Poland last week I've gotten a few requests for examples of using Sinon.JS with QUnit. Sinon.JS is completely test framework agnostic and should be very easy to use with any testing framework. This post introduces a mini-plugin, sinon-qunit and shows a few examples of using Sinon.JS with QUnit. Spies, stubs and mocks Using one-off spies, stubs and mocks is straight
Example is a modified test from Morgan Roderick's PubSubJS. "test should call subscriber": function () { var spy = sinon.spy(); PubSub.subscribe("message", spy); PubSub.publishSync("message", undefined); assertTrue(spy.called); } Example is a modified test from Morgan Roderick's PubSubJS. "test should call all subscribers when exceptions": function () { var spy = sinon.spy(); var stub = sinon.stub
Today I needed remote access to a gem I've been tinkering with for a while, so I pushed it to Gemcutter. It's called jstdutil, and it provides a small Ruby wrapper over JsTestDriver that adds colored output, a short, snappy `jstestdriver` command and autotest. Install it The gem is available on Gemcutter, which requires that you install their gem (and use RubyGems >= 1.3.5): gem update --system ge
JavaScript continuous integration with Hudson and JsTestDriver JsTestDriver's JUnit compatible XML output makes it dead simple to set up JavaScript continuous integration. This post will help you get started with Hudson. Installing Hudson Setting up continuous integration with Hudson is pretty simple - especially if you're on a Debian based Linux. hudson-ci.org has a nice and simple recipe for ins
For best performance, CSS and JavaScript should be served up using as few requests and bytes as possible. Juicer is a new command line tool that helps by resolving dependencies, merging and minifying files. It can even check your syntax, add cache busters to and cycle asset hosts on URLs in CSS files and more. Background For web applications there's a screaming gap between development best practic
Recently I've been dabbling in the fantastic library that is node.js. Whenever I enter a new development environment I immediately poke around to figure out how to unit test things. I'm uncomfortable writing too much code without tests, especially when I'm on unfamiliar grounds. Here's what I landed on in round one. What node.js offers In case you haven't already checked it out, node.js is "Evente
RVM (Ruby Version Manager) is a hot tool which makes switching between Rubys (1.8.6, 1.8.7, 1.9.1, JRuby, you name it) as simple as `rvm use 1.9.1`. However, on Ubuntu, you may hit trouble when using the openssl package for any non-system provided Ruby version. Fixing openssl for Rvm-provided Ruby's On Ubuntu, apt is most commonly used to administrate Ruby. Using apt, openssl is a separate package
Gitorious is an open source Rails application for managing your projects: Git repositories, wikis, timeline and more. Not identical to, but not completely unlike GitHub. Being open source means you can set up your own Gitorious, even in private mode and host all your company's projects. In this article I'll show you how to get it running. I am going to guide you through installing Gitorious on an
このページを最初にブックマークしてみませんか?
『Christian Johansen - Software developer, musician, amateur baker』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く