This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEFORE: | |
sam@ubuntu discourse % rm -fr tmp/cache | |
sam@ubuntu discourse % rm -fr public/assets | |
sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile | |
58.55s user 1.79s system 100% cpu 1:00.02 total | |
AFTER: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
basedn = "uid=foo,ou=bar,c=baz" | |
attrs = ["mail", "cn", "sn", "objectclass"] | |
ldap.search(:base => basedn, :attributes => attrs) do |entry| | |
puts "DN: #{entry.dn}" | |
entry.each do |attr, values| | |
puts "#{attr}:" | |
values.each do |value| | |
puts "#{value}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DOMAIN=$1; shift | |
if [ -z "${DOMAIN}" ]; then | |
echo "No domain specified, assuming github.net" | |
DOMAIN="github.net" | |
fi | |
BASE=$(pwd) | |
ROOT_CA_KEYSIZE=4096 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Proposal for mapping responses back to requests for Net::LDAP. | |
require "fiber" | |
module Net | |
module LDAP | |
class Connection | |
# Hash of Responses keyed by message_id | |
attr_reader :responses | |
# Fake socket to read/write from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've always had a vision of GitHub as a roving pack of feral liquor store patrons, | |
migrating from section to section, stopping only to grab another bottle of rotgut | |
whiskey or slaughter an unsuspecting stockboy for food. | |
Code, I imagine, gets written on aisle 7 (cocktail olives, napkins, and mixers), | |
on tiny desks made from empty beer cases and wine bottles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
status = DATA.flock(File::LOCK_EX | File::LOCK_NB) | |
if status == 0 | |
puts "we have the lock..." | |
sleep | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
user daemon daemon; | |
http { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on http://bit.ly/215MBZ | |
function FailureDetector(ws) { | |
// ws stands for window size. | |
// How many heartbeat intervals we keep track of. | |
this.ws = ws || 100; | |
this.window = []; | |
this.last = null; | |
} | |
exports.FailureDetector = FailureDetector; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@_1 = -> | |
# sum of multiples of 3 or 5 (not both) under 1K | |
answer = 0 | |
for n in [1...1000] | |
if n % 3 == 0 or n % 5 == 0 | |
answer += n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read () { | |
open "http://blitherocher.com" | |
} | |
article () { | |
# change in to the directory where I keep my journal project | |
cd /projects/personal_projects/personal_site | |
echo "Creating article '$@'" |
OlderNewer