Skip to content

Instantly share code, notes, and snippets.

git checkout develop
git fetch
git pull
git checkout us_123_impl_foobar_feature
git merge origin/develop # Creates a new commit on us_123_impl_foobar_feature, that contains all changes from develop
git reset --soft origin/develop # Generates a set of staged changes
git add -A
git commit -m '[US-123] Adds Foobar'
git checkout develop
git merge us_123_impl_foobar_feature
@mjgpy3
mjgpy3 / pattern-matching.js
Created March 7, 2016 18:25
Easy pattern matching in JavaScript
'use strict';
const buildMatcher = (cases) => (actual) =>
cases
.find((cse) => cse.matches(actual))
.result(actual);
const buildNextOn = (previousCases) => {
var build = (matchesPred, result) => {
const cases = previousCases.concat(
@paton
paton / simple.js
Last active October 7, 2019 16:14
Super simple implementation of define() and require() used in Localize.js (https://localizejs.com)
var define, require;
(function() {
var modules = {};
require = function(name) {
return modules[name]();
};
define = function(name, fn) {
@todgru
todgru / aws-ec2-redis-cli.md
Created June 12, 2014 23:01
AWS redis-cli on EC2
@MatthewVita
MatthewVita / KOTemplateLoader.js
Last active August 29, 2015 13:57
KOTemplateLoader.js - Loader that easily renders external Knockout.js templates [jQuery dependency]
/*
* @desc: loads an external
* HTML Knockout.js template
* file, places it in the DOM,
* and applies the KO bindings
*
* @param: tmplFile - the template
* file
*
* @param: targetElem - the target
@brendonrapp
brendonrapp / gist:5944296
Created July 7, 2013 17:47
Fixes Powerline visual update delay when exiting from Insert mode
" make Esc happen without waiting for timeoutlen
" fixes Powerline delay
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
@jackinloadup
jackinloadup / generate-cowsay
Created December 7, 2010 20:04
bash file to generate a fortune from a random cowsay character
#!/bin/bash
cows[1]=beavis.zen
cows[2]=bong
cows[3]=bud-frogs
cows[4]=bunny
cows[5]=cheese
cows[6]=cower
cows[7]=daemon
cows[8]=default