This file contains hidden or 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 | |
############################################################################### | |
# Required Application Libraries # | |
############################################################################### | |
%w{ rubygems optparse ostruct socket yaml }.each { |lib| require lib } | |
############################################################################### | |
This file contains hidden or 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
# FSM Simulation | |
edges = { | |
[1, 'a'] => 2, | |
[2, 'a'] => 2, | |
[2, '1'] => 3, | |
[3, '1'] => 3 | |
} | |
accepting = [3] |
This file contains hidden or 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
do () -> | |
namespacer = (ns, obj) -> | |
if not typeof ns == "string" or not ns.length | |
throw new Error '[namespacer] Invalid namespace' | |
namespace = @ | |
namespace = namespace[part] = namespace[part] or {} for part in ns.split '.' | |
namespace[attr] = obj[attr] for attr of obj if typeof obj == 'object' | |
namespace | |
@['namespacer'] = @['ns'] = namespacer |
This file contains hidden or 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 | |
# Ruby implementation of the python Cache class from Box CRE "The 'One' Thing" by Peter Potrebic | |
$store = {} | |
$namespace = 'rcache' | |
class Cache < Object | |
def initialize(cache_name) |
This file contains hidden or 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
store = {} | |
store.setdefault = (key, def) -> | |
@[key] = def unless @[key] | |
@[key] | |
namespace = 'pcache' | |
formatKey = -> | |
[].slice.call(arguments).join '.' |
This file contains hidden or 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
module Nvidia | |
class LinkHelper < Liquid::Tag | |
Link = Struct.new :classes, :href, :id, :local, :name | |
def initialize(tagName, markup, tokens) | |
super | |
end | |
def hash_to_link link | |
Link.new link.fetch('classes'), link.fetch('href'), link.fetch('id'), link.fetch('local'), link.fetch('name') |
This file contains hidden or 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
def titlize(the_title) | |
system("echo '#{the_title.downcase.gsub!(' ', '-')}' | pbcopy") | |
end |
This file contains hidden or 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 | |
if ARGV[0].nil? | |
raise "Expecting a string as the first argument" | |
end | |
require 'base64' | |
based = Base64.encode64 ARGV[0] | |
if !ARGV[1].nil? && ARGV[1] == 'sep' |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>CFBundleDevelopmentRegion</key> | |
<string>en</string> | |
<key>CFBundleExecutable</key> | |
<string>$(EXECUTABLE_NAME)</string> | |
<key>CFBundleIdentifier</key> | |
<string>biz.interdev.$(PRODUCT_NAME:rfc1034identifier)</string> |
This file contains hidden or 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
<html> | |
<head> | |
<title>Wedding Photography Rates 2015</title> | |
<style> | |
body, h1, h2, h3, h4, h5, h6, hr, p, ul { margin: 0; padding: 0; } | |
header { text-align: center; margin: 0 0; } | |
.logo { width: 200px; } | |
h1, h2, h3, h4, h5, h6 { text-align: center; text-transform: uppercase; } | |
h2 { margin: 35px 0; } |