Skip to content

Instantly share code, notes, and snippets.

View wamatt's full-sized avatar

Matt Tagg wamatt

  • Palo Alto, California
View GitHub Profile
@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.

@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@cowboy
cowboy / sudo-keepalive-example.sh
Created July 15, 2012 20:55
Bash: Sudo keep-alive (good for long-running scripts that need sudo internally but shouldn't be run with sudo)
#!/bin/bash
# Might as well ask for password up-front, right?
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Example: do stuff over the next 30+ mins that requires sudo here or there.
function wait() {
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@jedi4ever
jedi4ever / nodejs-cluster-zero-downtime.md
Last active February 11, 2024 13:45
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@samsondav
samsondav / disable-gmail-cmd-enter.user.js
Last active January 22, 2024 15:42
Disable cmd+enter send in gmail
// ==UserScript==
// @name Gmail disable cmd+enter
// @namespace sampdavies@gmail.com
// @description Disables cmd+enter from sending an email in gmail
// @include ^https?:\/\/mail\.google\.com.*$
// @version 1
// @grant none
// ==/UserScript==
(function(){
var isMac = unsafeWindow.navigator.oscpu.toLowerCase().contains("mac os x");
@dschep
dschep / gist:4105713
Last active March 21, 2023 01:47
Gmvault on Synology NAS
  1. Install Python from DSM Package Center
  2. Enable SSH
  3. SSH in
  4. Enable and switch to user shell (optional, requres user homes to be enabled)
    • set shell to /bin/ash in /etc/passwd
    • su - <user>
  5. Create directory to store all of this (optional)
    • mkdir gmvault&&cd gmvault
  6. Get virtualenv
  • wget https://raw.github.com/pypa/virtualenv/develop/virtualenv.py
@wolever
wolever / profile
Created September 11, 2013 15:41
My very fast Bash prompt, which shows git branch, virtualenv, and background jobs
# prompt examples:
# [3 jobs master virtualenv] ~/code/myproject/foo
# [1 job my-branch virtualenv] ~/code/bar/
# [virtualenv] ~/code/
# ~
# Very, very fast, only requiring a couple of fork()s (and no forking at all to determine the current git branch)
if [[ "$USER" == "root" ]]
then
export PS1="\e[1;31m\]\u \[\e[1;33m\]\w\[\e[0m\] ";
@Watson1978
Watson1978 / macruby_uninstall
Created February 27, 2012 23:43
MacRuby : uninstaller
#!/bin/bash
# MacRuby
rm -rf /Library/Frameworks/MacRuby.framework
XCODE_DIR=`xcode-select -print-path`
# tool
rm -f "$XCODE_DIR"/usr/bin/rb_nibtool
rm -f "$XCODE_DIR"/Tools/rb_nibtool