Skip to content

Instantly share code, notes, and snippets.

View scrabble_benchmarking.rb
POINTS = {
"A" => 1, "B" => 3, "C" => 3, "D" => 2,
"E" => 1, "F" => 4, "G" => 2, "H" => 4,
"I" => 1, "J" => 8, "K" => 5, "L" => 1,
"M" => 3, "N" => 1, "O" => 1, "P" => 3,
"Q" => 10, "R" => 1, "S" => 1, "T" => 1,
"U" => 1, "V" => 4, "W" => 4, "X" => 8,
"Y" => 4, "Z" => 10
}
View scrabble_benchmarking.rb
POINTS = {
"A" => 1, "B" => 3, "C" => 3, "D" => 2,
"E" => 1, "F" => 4, "G" => 2, "H" => 4,
"I" => 1, "J" => 8, "K" => 5, "L" => 1,
"M" => 3, "N" => 1, "O" => 1, "P" => 3,
"Q" => 10, "R" => 1, "S" => 1, "T" => 1,
"U" => 1, "V" => 4, "W" => 4, "X" => 8,
"Y" => 4, "Z" => 10
}
@mipearson
mipearson / bm_test.go
Last active Aug 19, 2021 — forked from davecheney/bm_test.go
Add an increment of a global variable after each op to ensure the Go compiler isn't being clever about optimisation.
View bm_test.go
package bm
import (
"testing"
)
var mb = map[string]bool{
"alpha": true,
"beta": true,
"gamma": true,
View continuation.md

https://twitter.com/davecheney/status/447523678561898496

Why do I think Go is more 'distributed' than other languages, and why do I think that is a good thing ?

  1. Go does not have a BDFL, there is no Guido Van Rossem, no Theo De Ralt, etc. We have our spiritual leaders like Rob Pike and Ken Thompson, but their influence is much less immediate.

  2. The very nature of the development of the Go standard library discourages adding new stuff to the standard library.

2a. I believe this is a good thing

View carrierwave_utf8.rb
def ensure_utf8
# TODO Proper solution using https://github.com/brianmario/charlock_holmes & detection
# processing copied from http://trackingrails.com/posts/video-encoding-processor-for-carrierwave
cache_stored_file! if !cached?
file_data = File.read(current_path)
# Ugh. Only way to detect bad UTF8. See
# http://bibwild.wordpress.com/2012/04/17/checkingfixing-bad-bytes-in-ruby-1-9-char-encoding/
is_valid_utf8 = begin
@mipearson
mipearson / fmserverpositions.md
Created Nov 15, 2012 — forked from mjdgraaf/fmserverpositions
Firemonkeys server engineer positions
View fmserverpositions.md

November 15, 2012

Firemonkeys, Melbourne-based game development studio, is looking to contract server engineers on a short term basis. There are three positions we are looking to fill:

DBA:

  • Knows how to use “EXPLAIN”
  • Preferably has used maatkit or percona-toolkit
  • Can optimise MySQL queries and apply indexes, and understands the impact of adding too many indexes
@mipearson
mipearson / env.rb
Created Jul 8, 2012 — forked from pacoguzman/env.rb
features/support/env.rb for use with Rails 3 & Spork
View env.rb
# -*- encoding : utf-8 -*-
require 'rubygems'
require 'spork'
# From https://gist.github.com/123370
Spork.prefork do
ActiveSupport::Deprecation.silenced = true
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
@mipearson
mipearson / contracting.md
Created Nov 9, 2011 — forked from mwotton/gist:1350517
Nicholas F on Contracting Rates
View contracting.md

How to calculate an hourly rate.

Hi,

I've been watching job boards for Ruby related contracts lately and have noticed some low rates being offered with high expectations. It's happening frequently enough that I wanted to post my understanding of how to calculate an hourly rate. Setting reasonable standards of pay for the appropriate level of expertise is vital. There's a lot to say on the matter, so I've tried to be brief.

For some reason it's very easy for software developers to match their experience and knowledge to a full-time rate, but for contracting there is less awareness.

The difference between full-time employment and self employment.