Skip to content

Instantly share code, notes, and snippets.

@noxqsgit
noxqsgit / cms_dump.rake
Last active December 28, 2015 03:09
DOES NOT WORK, USE https://github.com/obfusk/active-dump // seed_dump + comfortable-mexican-sofa
# seed_dump + comfortable-mexican-sofa
# $ cp .../cms_dump.rake lib/tasks/
# $ rake db:seed:dump:cms
models = %w{
Cms::Block Cms::Layout Cms::Page Cms::Revision Cms::Site
}
namespace :db do
namespace :seed do
@noxqsgit
noxqsgit / README.md
Last active December 27, 2015 18:39
nap switch branch

nap (remote)

nap stop APP

apps/APP (local)

git checkout stable
git push REMOTE stable
git branch -d master
@obfusk
obfusk / 7z.bash
Created October 20, 2013 19:18
7z w/ encryption
7z a -mhe=on -p foo.7z foo/
@obfusk
obfusk / README.md
Created October 20, 2013 19:15
build ffmpeg

Prepare

$ aptitude install yasm libvorbis-dev libvpx-dev libsdl1.2-dev

Build

$ mkdir -p ~/tmp/build && cd ~/tmp/build
$ git clone git://source.ffmpeg.org/ffmpeg.git

$ cd ffmpeg

@obfusk
obfusk / relpath.bash
Created October 20, 2013 19:14
relative path
# 1
# usage: relpath <to> <from>
relpath () { python -c \
'import os.path, sys; print os.path.relpath(*sys.argv[1:])' "$@"; }
# 2
rel_bin="${bin#"$PREFIX"}"
@obfusk
obfusk / grep.sh
Created October 20, 2013 19:11
DO NOT USE "foo $@ bar" !!! only use "$@" !!!
grep -R '[^"]\$@\|\$@[^"]' --exclude-dir=.git . 2>/dev/null | grep -v Binary
@obfusk
obfusk / sig.bash
Created October 20, 2013 19:10
sigusr1 + wait
ME=$$; echo "I'm $ME"
( echo $BASHPID; sleep 5; echo 1; kill -SIGUSR1 $ME ) &
( echo $BASHPID; sleep 10; echo 2; kill -SIGUSR1 $ME ) &
( echo $BASHPID; sleep 15; echo 3; kill -SIGUSR1 $ME ) &
foo () { echo "USR1 received"; }
bar () { echo "USR2 received"; }
trap foo SIGUSR1
@obfusk
obfusk / reduce_mbind.coffee
Created October 20, 2013 19:06
obfusk.coffee - reduce + mbind
O = require 'obfusk'; U = require 'underscore'
f = (x) -> O.Just x + 1
g = (x) -> O.Just x * 42
h = (x) -> O.Nothing()
x = U.reduce([f,g], O.mbind, O.Just(2))
y = U.reduce([f,h,g], O.mbind, O.Just(2))
console.log O.match(x, Nothing: (-> 'too bad'), Just: ((x) -> "#{x.value}!!!"))
@obfusk
obfusk / ackrc
Last active December 25, 2015 09:49
ackrc
--type-set=clojure=.clj,.cljs
--type-set=coffeescript=.coffee
--type-set=markdown=.md,.markdown
--type-set=racket=.rkt
@obfusk
obfusk / FREEDOM.md
Last active December 23, 2015 11:39
fsfe Freiheit! flyer translated to Dutch and English

Freedom!

What Free Software and tools have in common

A comparison

Free Software gives us essential freedom that other software denies