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
function ${name}(${parameters}) {${cursor}} |
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
# GIT IMMERSION tutorial | |
# http://gitimmersion.com/lab_11.html | |
# Add the following to the .gitconfig file in your $HOME directory. | |
[alias] | |
co = checkout | |
ci = commit | |
st = status | |
br = branch | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
type = cat-file -t |
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
# checkout the old tag | |
git checkout old | |
# create a new tag | |
git tag new | |
# delete the old tag on local git repository | |
git tag -d old | |
# delete the old tag on remote git repository | |
git push origin :refs/tags/old |
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
var vows = require('vows'); | |
var assert = require('assert'); | |
var testSuite = vows.describe('Scenario: Test Fake API Scenario'); | |
testSuite.addBatch({ | |
'GIVEN some context' : { | |
'WHEN I do something' : { | |
topic: function () { return something('value', this.callback); }, | |
// then the do something should return anything |
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
// Get more info about APIEasy: https://github.com/flatiron/api-easy | |
// This example is originated from the Readme page of APIEasy project page. | |
// I made this gist just to keep the collection of Vows examples test suite I have to learn. | |
var request = require('request'), | |
vows = require('vows'), | |
assert = require('assert'); | |
vows.describe('your/awesome/api').addBatch({ | |
"When using your awesome api": { |
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 | |
# generate the file name using the string provided on the args | |
ffmpeg -f x11grab -r 25 -s 1366x768 -i :0.0 -vcodec libx264 -sameq $1.mp4 |
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
moment = function() { | |
return (require('moment-timezone')).tz('America/New_York'); | |
}, | |
console.log(moment().format()); | |
console.log(moment().day()); | |
console.log(moment().endOf('day').format()); | |
console.log(moment().endOf('day').format()); |
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
Something | |
.findOne({ | |
where: { | |
id: somethingId | |
} | |
}) | |
.then(function(something) { | |
if (!something) { | |
res.notFound('Something is not found.'); | |
return; |
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
Something | |
.findOne({ | |
where: { | |
id: somethingId | |
} | |
}) | |
.then(function(something) { | |
throw new Error('something not found'); | |
return doSomethingCool(); |
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
git push origin && git branch -D working-on-issue-11 | |
Counting objects: 20, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (10/10), done. | |
Writing objects: 100% (11/11), 4.10 KiB, done. | |
Total 11 (delta 9), reused 0 (delta 0) | |
remote: bb/acl: me is allowed. accepted payload. | |
Auto packing the repository for optimum performance. | |
fatal: protocol error: bad line length character: Remo | |
error: error in sideband demultiplexer |