Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am speier on github.
  • I am speier (https://keybase.io/speier) on keybase.
  • I have a public key whose fingerprint is 0D74 6267 5850 AF29 09EA FD27 D938 278D 8250 3A95

To claim this, I am signing this object:

<script type="text/javascript" src="http://www.sveido.com/mermaid/dist/mermaid.full.min.js"></script>
<div class="mermaid">
graph LR;
D(Developer)-->|push|GH(GitHub);
GH-->|test|C(CircleCI);
C-->|build|P(Private Registry);
P---|store|G(GCS);
D-->|deploy|K(Kubernetes Master);
P---K;
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
#!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) {