body { | |
white-space: pre; | |
font-family: monospace; | |
color: #ddd; /* Light grey color for general text */ | |
background-color: black; /* Black background */ | |
} | |
a { | |
color: #66ccff; /* Light blue color for links */ | |
text-decoration: none; /* Removes the underline */ |
There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.
Protocol Buffers v3.0.0. release notes:
The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.
Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.
#compdef thor | |
#autoload | |
TIME=`expr $(date +%s) / 60` | |
TMP_FILE=`echo "/tmp/thor_cached_comps.$TIME.txt"` | |
if [ -e $TMP_FILE ]; then | |
# do nothing | |
else |
class NormalizeNetworkSupplierWebsites < ActiveRecord::Migration | |
class NetworkSuppliersTable < ActiveRecord::Base | |
self.table_name = "network_suppliers" | |
end | |
def up | |
NetworkSuppliersTable.where("website IS NOT NULL").find_each do |record| | |
record.website = record.website.to_s.split.grep(UrlValidator::REGULAR_EXPRESSION).first # The first valid website or nil | |
record.save! if record.changed? |
brew uninstall wkhtmltopdf && brew install https://raw.github.com/mxcl/homebrew/6e2d550cf4961129a790bfb0973f8e88704f439d/Library/Formula/wkhtmltopdf.rb |
connection = Faraday::Connection.new('http://example.com') do |builder| | |
builder.request :url_encoded # for POST/PUT params | |
builder.adapter :net_http | |
end | |
# same as above, short form: | |
connection = Faraday.new 'http://example.com' | |
# GET | |
connection.get '/posts' |
require 'pp' | |
require 'irb/completion' | |
require 'rubygems' | |
require 'wirble' | |
require 'hirb' | |
Wirble.init | |
Wirble.colorize | |
IRB.conf[:AUTO_INDENT]=true |
def sum_data(index, page, data) | |
t = [] | |
page.each do |p| | |
if t.length == 0 | |
t = get_data_array(p, index, data) | |
else | |
temp = get_data_array(p, index, data) | |
t.each_index do | i | | |
t[i] += temp[i] | |
end |
This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.
Many thanks to funny-falcon for the performance patches.