Instantly share code, notes, and snippets.

View Gemfile
source ''
gem 'nokogiri'
View gist:8598858
def on_subdomain name, &block
rack_test_session.instance_variable_set :@default_host, "#{name}"

Learn a variety of programming paradigms

  • Write a program in assembly language
  • Write an application in a functional language
  • Write an application in an object-oriented language
  • Write an application in a prototype-based language
  • Write an application in a logic programming language
  • Write an application using the Actor model
  • Write an application in Forth
  • Write an application in Lua
View .osx
#!/usr/bin/env bash
# ~/.osx —
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
View gist:f0acd0adc5dc8bcbe2e1
module CallbackyReturns
def possible_responses given_responses
given_responses.each do |ret|
define_method ret do |&block|
return unless @status == ret
View gist:e7c8d2bc453d58b9ed5a
# Using Praises to show 2 windows, and output text to one of them,
# and halt with a “press any key to continue” prompt
w1 = '100%', height: '50%', show: true)
w2 = '100%', height: '50%', bottom: 0, show: true)
w1.puts "This is the top window"
View gist:1db118dbad76edfff040
# Menu bar
class MyWindow < Praises::Window
menu do
item :help, 'Help' do
item :about 'About'
item :file 'File' do

Keybase proof

I hereby claim:

  • I am sardaukar on github.
  • I am sardaukar ( on keybase.
  • I have a public key whose fingerprint is 7AB6 C47E 0B86 7ECA 0229 F856 A8C4 1D3D A028 94E4

To claim this, I am signing this object:


I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

# Automounter master map
+auto_master		# Use directory service

Reposted from Qiita

For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.

Why I'm tired of using and teaching flux

There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.

If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow: