Skip to content

Instantly share code, notes, and snippets.

@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@pkyeck
pkyeck / gist:5318298
Last active December 15, 2015 20:28
GIT colors
[color]
ui = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
@fcalderan
fcalderan / perftest.sh
Last active March 8, 2017 14:37
A small bash utility for testing slower connection. Use chmod +x perftest.sh to make the script executable. Thanks to Matteo Rosati for sharing basic commands
#!/bin/sh
CMD="$1"
RATE="$2"
DELAY="$3"
if [ "$RATE" = "" ] ; then
RATE=500
fi
if [ "$DELAY" = "" ] ; then
@ahomu
ahomu / grunt-yslow.js
Created November 22, 2012 08:13
WIP: HARを取得して、Yslowで評価するぞくん
module.exports = function(grunt) {
'use strict';
var TEMP_HAR_RESOURCE = '.har.tmp';
var exec = require('child_process').exec,
YSLOW = require('yslow').YSLOW,
doc = require('jsdom').jsdom(),
util = grunt.utils || grunt.util,
@tj
tj / some.sh
Created October 11, 2012 18:45
change terminal tab name on cd
function tabname {
printf "\e]1;$1\a"
}
if [ x`type -t cd` == "xfunction" ]; then
# previously wrapped cd
eval $(type cd | grep -v 'cd is a function' | sed 's/^cd/original_cd/' | sed 's/^}/;}/' )
else
# builtin
eval "original_cd() { builtin cd \$*; }"
@burin
burin / gist:3840737
Created October 5, 2012 16:06
Full screen web app in iPhone 5 (save to home screen)
<!-- standard viewport tag to set the viewport to the device's width
, Android 2.3 devices need this so 100% width works properly and
doesn't allow children to blow up the viewport width-->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<!-- width=device-width causes the iPhone 5 to letterbox the app, so
we want to exclude it for iPhone 5 to allow full screen apps -->
<meta name="viewport" id="vp" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
<!-- provide the splash screens for iPhone 5 and previous -->
<link href="assets/splashs/splash_1096.png" rel="apple-touch-startup-image" media="(device-height: 568px)">
<link href="assets/splashs/splash_iphone_2x.png" rel="apple-touch-startup-image" sizes="640x960" media="(device-height: 480px)">
@ykhs
ykhs / _linear-gradient.scss
Created September 10, 2012 11:55
linear-gradient Sass Mixin
@mixin linear-gradient($angle, $color-stops...) {
$_angle-with-vendor-prefix: "";
$_angle: "";
@if $angle == "to top" or $angle == "bottom" {
$_angle-with-vendor-prefix: bottom;
$_angle: to top;
} @else if $angle == "to right" or $angle == "left" {
$_angle-with-vendor-prefix: left;
$_angle: to right;
} @else if $angle == "to bottom" or $angle == "top" {
@karlhorky
karlhorky / grayscale-disable.css
Created August 26, 2012 12:17
Cross-Browser CSS Grayscale
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: