Skip to content

Instantly share code, notes, and snippets.

@jimmycuadra
jimmycuadra / debounce.js
Created September 13, 2012 00:55
Debounce question
/*
Fill in the body of the `debounce` function, such that running
the following code will output "fn was called with 10!" only once.
*/
(function () {
var debounce, fn, i;
debounce = function (func, wait) {
// ...
};
@jimmycuadra
jimmycuadra / beget.js
Created September 6, 2012 19:33 — forked from ClayShentrup/beget.js
Beget question (prototypal inheritance)
function beget(parent, child) {
// Add code here to make test() return true.
}
function test(){
var c;
function Parent() {
throw 'exception';
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 18, 2025 15:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@hrldcpr
hrldcpr / tree.md
Last active January 6, 2025 22:43
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@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