Skip to content

Instantly share code, notes, and snippets.

View winterbe's full-sized avatar
🐺
I ♡ full stack programming!

winterbe

🐺
I ♡ full stack programming!
View GitHub Profile
@nikreiman
nikreiman / gist:1222474
Created September 16, 2011 16:24
Git safe pull
function git-pull-safe() {
local currentBranch=$(git-branch-current)
local localLastCommit=$(git log --format="%H" $currentBranch | head -1)
local localLastPushCommit="$(git log --format="%H" origin/${currentBranch}.. | tail -n-1)^"
#local remoteLastCommit=$(git log origin/$currentBranch | head -1 | cut -f 2 -d ' ')
git fetch origin $currentBranch
local remoteHeadCommit=$(git log --format="%H" origin/$currentBranch | head -1)
if [ "$remoteHeadCommit" = "$localLastCommit" ] ; then
# Same message as git pull prints in this case
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dtao
dtao / eachAsync.js
Created April 10, 2012 14:52
Function to asynchronously iterate over a collection
function eachAsync(collection, iterator, callback) {
var iterate = function(i) {
setTimeout(function() {
iterator(collection[i]);
if (i < collection.length) {
iterate(i + 1);
} else {
callback();
}
}, 0);
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active November 14, 2024 15:40
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@sundararajana
sundararajana / Main.java
Last active September 4, 2015 13:37
Simple #nashorn demo "eval"s script with arbitrary script object bound for "this"
Moved to openjdk nashorn project.
Please check "samples" directory in http://hg.openjdk.java.net/jdk9/dev/nashorn.

Git DMZ Flow

I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.

  • Two developers working on independent features must never be blocked by each other
    • No code freeze! Ever! For any reason!
  • A developer must be able to base derivative work on another developer's work, without waiting for any third party
  • Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
  • Developers must be able to work on multiple features simultaneously, or at lea
anonymous
anonymous / README.md
Created October 19, 2015 19:01

If you have total freedom, in which language would you love to write all day?

You can answer with the language you love and why. Or upvote an answer if the language is already mentioned there.

Thanks! Just being curious :)

@mmazzarolo
mmazzarolo / mobxLogger.js
Created May 30, 2016 13:10
While waiting for React-Native MobX devtools...
import mobx from 'mobx'
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;'
// Just call this function after MobX initialization
// As argument you can pass an object with:
// - collapsed: true -> shows the log collapsed
// - style -> the style applied to the action description
export const startLogging = ({ collapsed, style } = {}) => {
mobx.spy(event => {