Test data is from http://apps.timwhitlock.info/emoji/tables/unicode
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'stringio'
data = File.read(ARGV.first)
data.each_codepoint do |codepoint|
require 'digest' | |
# From activestorage | |
def compute_checksum_in_chunks(io) | |
Digest::MD5.new.tap do |checksum| | |
while chunk = io.read(5242880) | |
checksum << chunk | |
end | |
io.rewind | |
end.base64digest |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# Every Vagrant development environment requires a box. You can search for | |
# boxes at https://atlas.hashicorp.com/search. | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
config.vm.provision "shell", privileged: false, inline: <<-SHELL |
#!/usr/bin/env ruby | |
require "rubygems" | |
require "my_obfuscate" | |
obfuscator = MyObfuscate.new({ | |
:people => { | |
:email => { :type => :email, :skip_regexes => [/^[\w\.\_]+@my_company\.com$/i] }, | |
:ethnicity => :keep, | |
:crypted_password => { :type => :fixed, :string => "SOME_FIXED_PASSWORD_FOR_EASE_OF_DEBUGGING" }, | |
:salt => { :type => :fixed, :string => "SOME_THING" }, |
module ObjectComparisonHelper | |
def deep_hash_diff(obj1, obj2, path = 'root', differences = []) | |
if obj1.class != obj2.class | |
differences << "object types differ at #{path}: #{obj1.class} vs #{obj2.class}" | |
else | |
case obj1 | |
when Hash, HashWithIndifferentAccess | |
differences << "key sets differ at #{path}: #{obj1.keys.inspect} vs #{obj2.keys.inspect}" if obj1.keys.to_set != obj2.keys.to_set | |
obj1.each do |key, value| | |
deep_hash_diff(value, obj2[key], "#{path}.#{key}", differences) |
Test data is from http://apps.timwhitlock.info/emoji/tables/unicode
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
require 'stringio'
data = File.read(ARGV.first)
data.each_codepoint do |codepoint|
San Francisco 4821 | |
London 1409 | |
Seattle, WA 1083 | |
New York, NY 2056 | |
Portland, OR 949 | |
Chicago, IL 930 | |
Tokyo, Japan 1518 | |
London, UK 894 | |
japan 880 | |
Germany 856 |
2.1.2 :004 > pp Google::Contacts.new(client).contacts | |
[{:emails=>{:other=>{:address=>"fake@gmail.com", :primary=>true}}, | |
:phone_numbers=> | |
{:main=>"(555) 123-1234", :home=>"123-123-1234", :mobile=>"555-555-5555"}, | |
:handles=> | |
{:home=>{:address=>"something", :protocol=>"AIM"}, | |
:other=>{:address=>"something-else", :protocol=>"AIM"}}, | |
:nickname=>nil, | |
:websites=>[], |
[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[ |
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
pic := make([][]uint8, dx) | |
for i := range(pic) { | |
pic[i] = make([]uint8, dy) | |
for j := range(pic[i]) { | |
pic[i][j] = uint8((i + j)/2) |