Skip to content

Instantly share code, notes, and snippets.

View jakobmattsson's full-sized avatar

Jakob Mattsson jakobmattsson

View GitHub Profile
@jakobmattsson
jakobmattsson / gist:7704638
Created November 29, 2013 11:49
Travis setup
travis encrypt my_npm_key --add deploy.api_key
travis encrypt api_token@'Deep Thought' --add notifications.hipchat.rooms
@jakobmattsson
jakobmattsson / gist:8038195
Last active December 31, 2015 20:09
Combinations - kodapor
flatten = (arrays) ->
result = []
arrays.forEach (array) ->
result = result.concat(array)
result
combinations = (n, values) ->
return [[]] if n <= 0
flatten [0 ... values.length].map (x) ->
@jakobmattsson
jakobmattsson / gist:9762351
Created March 25, 2014 13:55
HTTP request with promises
Q = require 'q'
request = require 'request'
req = (params) ->
deferred = Q.defer()
request params, (error, response, body) ->
return deferred.reject(new Error(error)) if error
deferred.resolve
statusCode: response.statusCode
headers: response.headers
@jakobmattsson
jakobmattsson / gist:10858811
Created April 16, 2014 11:41
Renaming an AWS-user using the CLI
AWS_ACCESS_KEY_ID=MYKEY AWS_SECRET_ACCESS_KEY=MYSECRET aws iam update-user --user-name OLDNAME --new-user-name NEWNAME

Keybase proof

I hereby claim:

  • I am jakobmattsson on github.
  • I am jakobm (https://keybase.io/jakobm) on keybase.
  • I have a public key whose fingerprint is BF01 CCA2 16A6 D68A 354D 84D5 E35C 2E0C A5D3 6189

To claim this, I am signing this object: