Skip to content

Instantly share code, notes, and snippets.

View alfanick's full-sized avatar
💭
I may be slow to respond.

Amadeusz Leonardo Juskowiak alfanick

💭
I may be slow to respond.
View GitHub Profile
@alfanick
alfanick / cache.rb
Created September 18, 2012 09:01
Simple Haml content caching
# Amadeusz Juskowiak <[email protected]> 2012 - MIT License
# 1. Put inside helpers do .. end
# 2. Set CACHE_DIR to somewhere writable and private (like CACHE_DIR=File.dirname(__FILE__) + '/tmp'
# 3. Use it! You can use fragment_expire to remove cache with given name.
#
# Example:
# %h1 foo
# = cache_fragment(:report, 300) do
# - data = get_data_slowly
@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

@alfanick
alfanick / quotes.sh
Created June 6, 2011 19:57
Random quotes from Forismatic
#!/bin/bash
curl "http://api.forismatic.com/api/?method=getQuote&lang=en&format=text" | sed -e 's/(/\
\
/g' | sed -e 's/ )//g' | sed -e 's/)//g'
@endolith
endolith / frequency_estimator.py
Last active October 26, 2024 20:10
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread