Skip to content

Instantly share code, notes, and snippets.

#!python2.7.exe
from dotcloudcli import cli
if __name__ == '__main__':
cli.main()
Feature: Addition
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
Scenario: Add two numbers
Given a calculator
When I sum 50 and 70
Then the result should be 120
[Binding]
class CalculatorSteps
{
private readonly StandardKernel _kernel = new StandardKernel();
private ICalculator _calc;
private int _lastResult;
public CalculatorSteps()
{
@speier
speier / gist:1009014
Created June 5, 2011 14:51
dotcloud.cmd
@setlocal enabledelayedexpansion && "c:\Python27\python.exe" -x "%~f0" %* & exit /b !ERRORLEVEL!
import sys
sys.path.append('c:\Python27\Lib\site-packages\dotcloud.cli-0.3.1-py2.7.egg\dotcloud\cli')
import cli
if __name__ == '__main__':
cli.main()
@speier
speier / redis-counters.coffee
Created August 15, 2011 08:46 — forked from mythz/redis-counters.coffee
Create and increment multiple counters with express, coffeescript and redis
#1. install node, npm and coffeescript
#2. >npm install express
#3. >npm install node_redis
#4. >npm install -d
redis = require('redis').createClient()
redis.on 'error', (err) -> console.log "Redis connection error to #{redis.host} : #{redis.port} - #{err}"
app = require('express').createServer()
#create and increment multiple counters in redis, via: http://localhost:3000/counters/my-counter
@speier
speier / README.md
Created September 1, 2011 18:53 — forked from chrisjacob/README.md
QUICK setup Github Pages + Cloud9 IDE for HTML/CSS/JavaScript hacking

QUICK setup Github Pages + Cloud9 IDE for HTML/CSS/JavaScript hacking

GitHub + GitHub Pages

  1. Get a GitHub account: https://github.com/
  2. Github > Dashboard > New Repository ... https://github.com/repositories/new
  3. Enter a Project Name and Description; click "Create Repository"
  4. On the project page ignore the suggested setup instructions... instead click on the "Admin" button
  5. Check the "GitHub Pages" checkbox... You'll get a popup.
  6. Click the "Automatic GitHub page Generator" button.
  7. Choose a funky colour... or go safe with just white... then click "Create Page" button
@speier
speier / paginated_collection.js
Created September 8, 2011 08:17 — forked from io41/paginated_collection.js
Pagination with Backbone.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@speier
speier / rubicon.coffee
Created September 8, 2011 08:18
Simple HTTP proxy for our node.js development environment
#!/usr/bin/env ./node_modules/coffee-script/bin/coffee
sys = require 'sys'
express = require 'express'
assets = require 'connect-assets'
proxy = require 'http-proxy'
server = proxy.createServer (req, res, proxy) ->
if req.url.match /^\/?api/
backend =
@speier
speier / JS Util solution using underscore.js
Created September 8, 2011 21:14 — forked from HenrikJoreteg/JS Util solution using underscore.js
Rather than creating some other util global, just extend underscore.js with any additional methods you want.
// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/)
// Then, use underscore's mixin method to extend it with all your other utility methods
// like so:
_.mixin({
escapeHtml: function () {
return this.replace(/&/g,'&')
.replace(/>/g,'>')
.replace(/</g,'&lt;')
.replace(/"/g,'&quot;')
.replace(/'/g,'&#39;');
@speier
speier / package.json
Created April 11, 2012 14:14
Basic npm package for Meteor
{
"name": "Meteor",
"version": "0.3.2",
"description": "A new way to build apps.",
"author": "Meteor Development Group",
"homepage": "http://www.meteor.com/",
"repository": {
"url": "https://github.com/meteor/meteor"
},
"dependencies": {