Skip to content

Instantly share code, notes, and snippets.

View MichaelPaulukonis's full-sized avatar

Michael Paulukonis MichaelPaulukonis

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.

anonymous
anonymous / gist:10675250
Created April 14, 2014 19:11
Motion Blur + Chromatic Aberration
// by dave @ beesandbombs.tumblr.com >:)
void setup() {
setup_();
result = new int[width*height][3];
result_ = new int[width*height][3];
}
int[][] result, result_;
float time;
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@tullyhansen
tullyhansen / gist:7621632
Last active October 10, 2022 13:11
Draft spec 0.3 for a bot taxonomy (see also http://i.imgur.com/bKXNQ0V.png) #botALLY
# Towards a Taxonomy of Twitter Bots
## Intro
- towards a definition - autonomous non-human agents on Twitter
- critical thinking - MECE, rabbit rule, holding hands
- patterns of behaviour, rather than content
- Twitter largely a textual medium
- crossover between two broadest categories (automated/event-driven), but largely one or the other (maybe?)
- some bots will exhibit both behaviours (active/reactive), but tend to favour one (most commonly, tweeters will also exhibit conversationalist behaviours)
@jashmenn
jashmenn / self-eq-this-vs-bind.md
Last active September 6, 2022 23:11
Javascript var self = this; vs. .bind

The Problem

In Javascript this is bound in unexpected ways. Functions, in particular, create a new 'this' and so when you want to keep a reference to an "outer" object you sometimes see the pattern:

var self = this;

as in:

var self = this;
@VinGarcia
VinGarcia / walksync.js
Last active September 9, 2020 11:18 — forked from kethinov/walksync.js
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
if( dir[dir.length-1] != '/') dir=dir.concat('/')
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.addedNodes.length > 0 && mutation.addedNodes[0].nodeName == "CANVAS"){
// do stuff after the sketch loaded
}
});
});
var config = { attributes: false, childList: true, characterData: false }
target = document.getElementById("myDiv")
@bwillis
bwillis / git_commands.zsh
Last active November 8, 2018 02:28
Git and Github commands I use via .zshrc
# Git commands
# ggh - git url: get the url to the current github repo (assumes it's the remote push server)
# ggbn - git branch name: get the name of the current branch
# ggwip - git wip: commit the current staged and unstaged files with a commit message of WIP
# ggundo - git undo: pull the last commit off as staged changes
# ggbh - git branch history: list the 6 recent branches by commit date
# ggbs - git branch smart history: list the 6 recent branches by commit date without master, staging or production
# ggbl - git branch last: get the last branch that is not master, staging or production
alias ggh="git remote -v 2> /dev/null | grep push | awk '{print \$2}' | sed 's/:/\//' | sed 's/git@\(.*\)\.git/https:\/\/\1/'"
@rawsyntax
rawsyntax / js2-mode.el
Created May 31, 2012 21:19
js2-mode with better indentation
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
;; Use js-mode indentation in js2-mode, I don't like js2-mode's indentation
;;
;; thanks http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode
;; with my own modifications
;;
(defun my-js2-indent-function ()