This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
echo Pushing $BRANCH to origin/$BRANCH and and origin/gh-pages | |
git push origin $BRANCH | |
git push origin $BRANCH:gh-pages | |
echo Pushed $BRANCH to origin/$BRANCH and and origin/gh-pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require('express') | |
app = express() | |
Instagram = require('instagram-node-lib') | |
Instagram.set 'client_id', '110a0f5f4aae44c58aa75dadc340f9ac' | |
Instagram.set 'client_secret', 'd198ac94655a4670bb3dedd0f220caab' | |
Instagram.set('callback_url', 'http://5aqc.localtunnel.com') | |
Instagram.tags.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.timer | |
.timer-progress | |
h2.question_body= body | |
.grey-holder | |
.red.rgb-block(data-color="red") | |
.fill | |
.green.rgb-block(data-color="green") | |
.fill | |
.blue.rgb-block(data-color="blue") | |
.fill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind generic f !@git fetch | |
bind generic p !@git pull | |
bind generic P !@git push | |
bind generic { !?git push -f | |
bind generic r !git rebase -i master | |
bind generic U !@git up | |
bind generic M !@git checkout master | |
bind generic ! !@git reset HEAD^ | |
bind generic @ !@?git reset --hard HEAD^ | |
bind generic a !git commit --amend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ob - a chainable object helper | |
# | |
# ob({foo:1, bar: 2, zap: undefined}) | |
# .compact() | |
# .map((v) -> v + 1) | |
# .value | |
# | |
# // {foo:2, bar: 3} | |
ob = (obj) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# directive to cause elements to have equal heights | |
# caveat -- they must share the same parent which contains this | |
# directive and an attribute of matchHeightOf = ".selector" | |
app.directive 'cssEqualHeight', ($window, $timeout) -> | |
restrict: 'A' | |
compile: (el, attrs) -> | |
$matchables = angular.element(el).find(attrs.matchHeightOf) | |
@matchHeights = makeHeightMatcher $matchables | |
angular.element($window).on 'resize', -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Logging, local variables, and a dash of opinion. | |
This gist intends to explore the impact of logging in software development. Briefly I should give | |
a bit of background: I'm not a fan of logging frameworks. The original intent of this article was | |
to present an argument against logging by examining: | |
1. How logging introduces state | |
2. Why local variables are bad | |
3. Proof that local variables are worse than logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove the heads off arrays of base_64 encoded datauris | |
# | |
# in this example we take the array of images encoded from | |
# whammy.js and return an array without the heads. This is | |
# an admittedly vain optimization but, every byte counts. | |
Base64Header = (type) -> | |
head: "data:#{type};base64," | |
add: (string) -> | |
"#{HEAD}#{string}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = express() | |
server = http.createServer app | |
io = require('socket.io').listen(server) | |
server.listen process.env.PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind generic f !@git fetch | |
bind generic p !@git pull | |
bind generic P !@git push | |
bind generic { !?git push -f | |
bind generic r !git rebase -i master | |
bind generic U !@sh -c "git checkout master && git pull && git checkout - && git rebase master" | |
bind generic M !@git checkout master | |
bind generic ! !@git reset HEAD^ | |
bind generic @ !@?git reset --hard HEAD^ | |
bind generic a !git commit --amend |
OlderNewer