http://ruby-china.org/topics/16256
get https://github.com/mvj3/hangman/blob/master/data/words.txt
and compile the decision tree.json
ruby compile.rb
""" | |
Dependencies: | |
pip install tabulate simplejson python-cjson ujson yajl msgpack-python | |
""" | |
from timeit import timeit | |
from tabulate import tabulate |
# -*-coding:utf-8-*- | |
'''cjson, jsonlib, simplejson, and yajl also use C code | |
demjson did not use C code, but was too painfully slow to benchmark | |
(took about 20 seconds for these tests) | |
''' | |
import json | |
import sys | |
import time |
*gz | |
*.txt |
(function () { | |
"use strict"; | |
var copyOwnProperties = function (from, to) { | |
for (var propertyName in from) { | |
if (from.hasOwnProperty(propertyName)) { | |
to[propertyName] = from[propertyName]; | |
} | |
} | |
}; |
http://ruby-china.org/topics/16256
get https://github.com/mvj3/hangman/blob/master/data/words.txt
and compile the decision tree.json
ruby compile.rb
#!/bin/sh | |
# | |
# https://gist.github.com/mvj3/6973600 | |
# | |
# unicorn - init.d script for single or multiple unicorn installations. Expects at least one .conf | |
# chkconfig: - 85 15 | |
# description: Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, | |
# high-bandwidth connections and take advantage of features in Unix/Unix-like kernels | |
# processname: unicorn | |
# config: /etc/unicorn/*.conf |
require 'rubygems' | |
require 'rack' | |
class Object | |
def webapp | |
class << self | |
define_method :call do |env| | |
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
[200, {}, send(func, *attrs)] | |
end |
xml.feed(:xmlns => "http://www.w3.org/2005/Atom") { |feed| | |
feed.title("#{user.name}'s Private Notification Feed") | |
feed.link(:href => "http://#{account.subdomain}.domain.com/feeds/#{user.email_alias}.xml", :rel => "self") | |
feed.link(:href => "http://#{account.subdomain}.domain.com") | |
} |