Skip to content

Instantly share code, notes, and snippets.

View squidsoup's full-sized avatar
🐾

Kit Randel squidsoup

🐾
View GitHub Profile
@dustin
dustin / sample-eventd-script-for-twisted
Created January 6, 2009 05:44
Sample upstart script for a twisted project.
# This is a sample script for upstart to keep a twisted project running.
# Place it in /etc/event.d/[projectname]
description "useful description"
author "Dustin Sallings <dustin@spy.net>"
start on runlevel 2
start on runlevel 3
stop on runlevel 0
@davidcalhoun
davidcalhoun / japan-jobs.md
Created July 31, 2011 01:53
Foreigner-friendly software companies in Japan
@nathanmarz
nathanmarz / gist:1228302
Created September 20, 2011 04:01
Example of defining a topology in Clojure
(use 'backtype.storm.clojure)
(use 'backtype.storm.config)
(require '[backtype.storm [thrift :as thrift]])
(import 'storm.starter.spout.RandomSentenceSpout)
(import 'backtype.storm.LocalCluster)
(defboltfull suffix-bolt ["word"]
:params [suffix]
:let [conf-state (atom nil)]
:prepare ([conf context collector]
@rajraj
rajraj / gist:1388849
Created November 23, 2011 14:46
Capybara Reference
# Credit: http://richardconroy.blogspot.com/2010/08/capybara-reference.html
#Navigating
visit('/projects')
visit(post_comments_path(post))
#Clicking links and buttons
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
@maxim
maxim / Rules
Created February 9, 2012 19:59
Convenient redirects with nanoc
#!/usr/bin/env ruby
# ...
preprocess do
RedirectGenerator.generate(config[:redirects], items)
end
route '/old_posts/*' do
item.identifier.sub('old_posts/', '') + 'index.html'
(def cds (collection))
;; interact with database
(go
(>! (:in cds)
{:op :create
:val {:title "Soft Machine Vol. 1"
:artist "Soft Machine"
:year 1969}})
@brutasse
brutasse / env.md
Last active December 25, 2015 13:09
Setting application environment variables on production servers

A great tool is envdir

apt-get install envdir
mkdir /etc/mysite.d/env
echo "postgres://postgres:@localhost:5432/mysite" > /etc/mysite.d/env/DATABASE_URL
echo "s3ce3t K3Y" > /etc/mysite.d/env/SECRET_KEY
echo "/srv/www/mysite/static" > /etc/mysite.d/env/STATIC_ROOT
echo "mysite.settings" > /etc/mysite.d/env/DJANGO_SETTINGS_MODULE
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
anonymous
anonymous / gist:56df524e2a58ffe65a1b
Created October 18, 2014 15:34
M-Audio ProjectMix I/O + midiman midisport 2x2 USB + Yosemite hack
Hi,
Quick and dirty way to get the M-Audio ProjectMix I/O (Firewire) and the M-audio Midiman 2x2 USB MIDI interface to work in Yosemite:
1) Unplug the two devices from your mac
2) Enable Kernel Extension Developer mode:
sudo nvram boot-args="kext-dev-mode=1"
3) Reboot
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted