Skip to content
View gist:f3a4f8855f0750e76657
================================================================================
Array(UnbufferedChannel((Nil | Exception+))) trace:
/usr/local/Cellar/crystal-lang/0.7.4/src/enumerable.cr:227
return elem if yield elem
^~~~
/usr/local/Cellar/crystal-lang/0.7.4/src/enumerable.cr:226
View osx_automount_nfs.md

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
View nginx.conf
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
#############################################################################
# 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
# Menu bar
class MyWindow < Praises::Window
menu do
item :help, 'Help' do
item :about 'About'
end
item :file 'File' do
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 = 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
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
#!/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 &
Something went wrong with that request. Please try again.