Put flip
somewhere in your $PATH
and chmod a+x
it.
Copy fuck
into ~/.bashrc
.
local function out_of_range(i,n) | |
if type(i) == 'number' then | |
if i > 0 and i <= n then return true | |
else error('out of range',3) | |
end | |
else | |
error 'cannot index array by non-number type' | |
end | |
end |
#!/usr/bin/env lua | |
-- Example application for the FastCGI handler with helper threads | |
local fastcgi = require "thfcgi" | |
local hello = {} | |
local heartbeat = [[ | |
local zmq = require "zmq" |
------------------------------------------------------------------------------ | |
-- Redis publication | |
-- | |
-- LICENCE: http://opensource.org/licenses/MIT | |
-- Vladimir Dronnikov <dronnikov@gmail.com> | |
------------------------------------------------------------------------------ | |
local db = assert(require("resty.redis"):new()) | |
db:set_timeout(1000) -- 1000 sec | |
assert(db:connect("127.0.0.1", 6379)) |
''' | |
redis_simple_chat.py | |
Written June 24, 2011 by Josiah Carlson | |
Released under the GNU GPL v2 | |
available: http://www.gnu.org/licenses/gpl-2.0.html | |
Other licenses may be available upon request. |
#!/bin/bash | |
# from http://habrahabr.ru/post/108240/ | |
ncpus=`grep -ciw ^processor /proc/cpuinfo` | |
test "$ncpus" -gt 1 || exit 1 | |
n=0 | |
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g` | |
do | |
f="/proc/irq/$irq/smp_affinity" |
I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs