Skip to content

Instantly share code, notes, and snippets.

getcwd("/home/couchdb", 8191) = 14
stat64("/home/couchdb/./erl_posix_msg.beam", 0xbffee2c4) = -1 ENOENT (No such file or directory)
open("/home/couchdb/./erl_posix_msg.beam", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/erlang/lib/kernel-2.13.2/ebin/erl_posix_msg.beam", 0xbffee2c4) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/erlang/lib/kernel-2.13.2/ebin/erl_posix_msg.beam", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/erlang/lib/stdlib-1.16.2/ebin/erl_posix_msg.beam", {st_mode=S_IFREG|0644, st_size=9272, ...}) = 0
open("/usr/local/lib/erlang/lib/stdlib-1.16.2/ebin/erl_posix_msg.beam", O_RDONLY|O_LARGEFILE) = 8
read(8, "FOR1\0\0$0BEAMAtom\0\0\4\303\0\0\0\217\rerl_pos"..., 9272) = 9272
close(8) = 0
getcwd("/home/couchdb", 8191) = 14
execve("/usr/local/bin/couchdb", ["couchdb"], [/* 14 vars */]) = 0
brk(0) = 0x81f7000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7894000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=23919, ...}) = 0
mmap2(NULL, 23919, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb788e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
class Job < CouchRestBase
include Delayed::Backend::Base
use_database :delayed_job
property :priority
property :attempts
property :handler
property :run_at
property :locked_at
property :locked_by
/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev.
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */
#import <Carbon/Carbon.h>
int main (int argc, const char *argv[])
{
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US"));
if (!english)
return 1;
@faust45
faust45 / stack.js
Created November 5, 2010 14:28 — forked from tj/stack.js
var error = new Error;
Object.defineProperty(global, '__stack', {
get: function(){
Error.prepareStackTrace = function(err, frames){
err.frames = frames;
};
try {
throw error;
} catch (err) {
# ruby 1.9 supports 4 ways to call a proc! ex: f =->n {[:hello, n]}; f[:ruby]; f.call(:ruby); f.(:ruby)
#
# turns out, you can also call a proc via proc === :arg -- which means you can use proc's in when clauses!
# ruby doc: http://ruby-doc.org/ruby-1.9/classes/Proc.html#M001165
#
# ... kudos to @chadfowler for the tip!
#
# (note: works on 1.8.7 as well :-))
def should_i_upgrade?
# ruby 1.9 supports 4 ways to call a proc! ex: f =->n {[:hello, n]}; f[:ruby]; f.call(:ruby); f.(:ruby)
#
# turns out, you can also call a proc via proc === :arg -- which means you can use proc's in when clauses!
# ruby doc: http://ruby-doc.org/ruby-1.9/classes/Proc.html#M001165
#
# ... kudos to @chadfowler for the tip!
#
# (note: works on 1.8.7 as well :-))
def should_i_upgrade?
@faust45
faust45 / gist:818530
Created February 9, 2011 14:07
Erlang snipets
% Dict
lookup(Key, [{Key,Value}|Rest]) ->
{value,Value};
lookup(Key, [Pair|Rest]) ->
lookup(Key, Rest);
lookup(Key, []) ->
undefined.
% Tree
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq)
singleton :: a -> Tree a
singleton x = Node x EmptyTree EmptyTree
treeInsert :: (Ord a) => a -> Tree a -> Tree a
treeInsert x EmptyTree = singleton x
treeInsert x (Node a left right)
| x == a = Node x left right
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq)
singleton :: a -> Tree a
singleton x = Node x EmptyTree EmptyTree
treeInsert :: (Ord a) => a -> Tree a -> Tree a
treeInsert x EmptyTree = singleton x
treeInsert x (Node a left right)
| x == a = Node x left right