Skip to content

Instantly share code, notes, and snippets.

@rom1504
rom1504 / gitStats.sh
Last active August 29, 2015 14:21
git stats
if [[ $# -ne 2 ]]
then
echo "usage : $0 <outputFile> <repo>"
exit 1
fi
outputFile=$1
repo=$2
rm $outputFile
cd $repo
git checkout master
@kuenishi
kuenishi / sync_git.py
Created January 14, 2011 06:14
sync all git dirs
import subprocess
import sys, os
def pull(dir):
print dir, ':'
os.chdir(dir)
subprocess.call(['git', 'pull'])
os.chdir('..')
map(pull, filter(os.path.isdir, os.listdir('.')))
@tlockney
tlockney / hack.sh
Created April 7, 2012 00:20 — forked from erikh/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
#
@ludofleury
ludofleury / getset.sublime-snippet
Created February 15, 2013 02:25
PHP (Symfony) oriented getter-setter snippet for Sublime Text
<snippet>
<content><![CDATA[
/**
* Get $1
*
* @return ${2:[type]} \$$1
*/
public function get${1/(.*)/\u$1/}()
{
return \$this->${1:$SELECTION};
@therealklanni
therealklanni / y-memo.js
Last active October 2, 2016 22:37
Memoized Y-Combinator in ES6
let Ym = (f, s = JSON.stringify) => (g => g(g))(x => f((...v) => (k => k in x ? x[k] : x[k] = x(x)(...v))(s(v))))
let fib = Ym(f => n => n <= 1 ? n : f(n - 1) + f(n - 2))
console.log('fib(1000)', fib(1000)) // => 4.346655768693743e+208

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

// p = require('./extract_meteor_deps');
// Package = p.Package;
// getPackageDeps = p.getPackageDeps; depsByPackage = p.depsByPackage;
//
// > getPackageDeps('spacebars')
// ['htmljs', 'blaze', 'observe-sequence', 'templating']
// > depsByPackage
// {"spacebars": ['htmljs', 'blaze', 'observe-sequence', 'templating']}
var Package, api, depsByPackage, getPackageDeps, mockApiUse, _;
@msysyamamoto
msysyamamoto / lib-hello_phoenix-memcached_supervisor.ex
Created September 1, 2015 15:13
Poolboy Sample on Phoenix Framework
defmodule HelloPhoenix.Memcached.Supervisor do
use Supervisor
def start_link do
Supervisor.start_link(__MODULE__, [])
end
def init([]) do
pool_options = [
name: {:local, :memcached_pool},
@ionelmc
ionelmc / .gitignore
Last active February 12, 2020 09:26
A JSON parser benchmark. See README.rst for instructions.
*.cbor
*.log
*.xml
*.yaml
*.json
*.msgpack
*.html
*.marshal
*.pickle
.tox
@felipetavares
felipetavares / simple_useful_slow.js
Last active December 15, 2020 12:39
Simple, Useful and Slow: Assorted Reference Statistics Functions (utf-8)
// Simple, Useful and Slow
// Assorted Reference Statistics Functions
// UTF-8 Edition
// Shorthands
pow = Math.pow
sqrt = Math.sqrt
pi = Math.PI