Skip to content

Instantly share code, notes, and snippets.

View mamapitufo's full-sized avatar

Alberto Brealey-Guzman mamapitufo

View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
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'];
@kelsey-sorrels
kelsey-sorrels / markov.clj
Created September 6, 2012 04:46
Overtone Internal Sequencer with Markov chains
(ns overtone.examples.internal-sequencer
(:use [overtone.live]))
;; A fully server-side sample sequencer.
;; =====================================
;; This example demonstrates some of the benefits of moving all synth
;; triggers inside the server itself. For example, it allows you to
;; modify the synthesis with *immediate* effect (rather than waiting for
;; the next bar/chunk to be scheduled) and you can use a global pulse to
@nickawalsh
nickawalsh / icons.sass
Last active October 7, 2021 09:38
Auto Hi-res Sprites
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd
@r00k
r00k / gist:4658025
Created January 28, 2013 18:50
Kinda mind-blowing fibonacci-sequence-producing function.
(defn fib [n]
(take n (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1]))))
(fib 5) => (1 1 2 3 5)
@jackrusher
jackrusher / gist:5139396
Last active March 29, 2023 21:02
Hofstadter on Lisp: Atoms and Lists, re-printed in Metamagical Themas.

Hofstadter on Lisp

In the mid-80s, while reading through my roommate's collection of Scientific American back issues, I encountered this introduction to Lisp written by Douglas Hofstadter. I found it very charming at the time, and provide it here (somewhat illegally) for the edification of a new generation of Lispers.

In a testament to the timelessness of Lisp, you can still run all the examples below in emacs if you install these aliases:

(defalias 'plus #'+)
(defalias 'quotient #'/)
(defalias 'times #'*)
(defalias 'difference #'-)
@codelahoma
codelahoma / everything-david-nolen-mentioned.markdown
Last active March 29, 2021 19:13
Quick and dirty bibliography for David Nolen's Lambda Jam 2013 keynote.

Everything David Nolen Mentioned

When watching David Nolen's excellent Lambda Jam keynote on InfoQ, the references to interesting reading came a little too fast and furious for me to jot down, so I went through the slides and put this gist together.

@mstade
mstade / view.md
Last active January 4, 2016 23:12
Some thoughts on application/view

Application views using HTTP trickery

If the client makes a request, let's say this is an initial request to a resource that the client knows nothing about. It goes along and does a little something like this:

GET /foo HTTP/1.1
Accept: text/html
@edlich
edlich / ClojureVimStateOfTheArt
Last active December 31, 2015 15:49
Current state of the art Clojure with vim description
VIM and Clojure:
The current steps might be (intended for vim beginners).
0A. Install Pathogen for easy vim installation (optional)
- https://github.com/tpope/vim-pathogen
- http://www.vim.org/scripts/script.php?script_id=2332
0B. Install new version of static runtime editing (optional, only if latest version is needed)
- https://github.com/guns/vim-clojure-static
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.