View nginx.conf
1 2 3 4 5 6 7 8 9 10
upstream foobar {
# uncomment the following line if multiple application servers are used.
# this will force nginx to send requests from the same client to the same
# application server.
# ip_hash;
server unix:///home/deploy/apps/sprout/shared/tmp/sockets/puma.sock fail_timeout=0;
}
 
server {
listen 80 default deferred;
View vash.rb
1 2 3 4 5 6 7 8 9 10
#############################################################################
# Class: Vash (Ruby Volatile Hash)
# Hash that returns values only for a short time. This is useful as a cache
# where I/O is involved. The primary goal of this object is to reduce I/O
# access and due to the nature of I/O being slower then memory, you should also
# see a gain in quicker response times.
#
# For example, if Person.first found the first person from the database & cache
# was an instance of Vash then the following would only contact the database for
# the first iteration:
View keybase.md

Keybase proof

I hereby claim:

  • I am sardaukar on github.
  • I am sardaukar (https://keybase.io/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:

View gist:1db118dbad76edfff040
1 2 3 4 5 6 7 8 9 10
# Menu bar
 
class MyWindow < Praises::Window
 
menu do
item :help, 'Help' do
item :about 'About'
end
 
item :file 'File' do
View gist:e7c8d2bc453d58b9ed5a
1 2 3 4 5 6 7 8 9
#
# Using Praises to show 2 windows, and output text to one of them,
# and halt with a “press any key to continue” prompt
#
w1 = Praises::Window.new(width: '100%', height: '50%', show: true)
w2 = Praises::Window.new(width: '100%', height: '50%', bottom: 0, show: true)
w1.puts "This is the top window"
Praises.blocking_getch
 
View gist:f0acd0adc5dc8bcbe2e1
1 2 3 4 5 6 7 8 9 10
module CallbackyReturns
 
def possible_responses given_responses
given_responses.each do |ret|
 
define_method ret do |&block|
return unless @status == ret
 
block.call(self)
end
View .osx
1 2 3 4 5 6 7 8 9
#!/usr/bin/env bash
 
# ~/.osx — http://mths.be/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 programming-achievements.md

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 gist:8598858
1 2 3 4
def on_subdomain name, &block
rack_test_session.instance_variable_set :@default_host, "#{name}.example.org"
yield
end
View Gemfile
1 2 3
source 'https://rubygems.org'
 
gem 'nokogiri'
Something went wrong with that request. Please try again.