Skip to content

Instantly share code, notes, and snippets.

View Intro_to_faker_gem.rb
require 'rubygems'
require 'faker'
#Let's see if we can make a fake person...
person_name =
person_email =
person_company =
person_company_slogan =
person_phone = Faker::PhoneNumber.phone_number
person_address = Faker::Address.street_address
View Faker_Loop.rb
require 'rubygems'
require 'faker'
require 'activerecord'
1000.times do
# make a person
# save this person
alexmoore /
Last active Sep 26, 2015 — forked from jasonrudolph/
Programming Achievements: How to Level Up as a Developer

Programming Achievements: How to Level Up as a Developer

  1. Select a particular experience to pursue.
  2. Pursue that experience to completion. (Achievement unlocked!)
  3. Reflect on that experience. Really soak it in. Maybe a blog post would be in order?
  4. Return to Step 1, this time selecting a new experience.

This gist is a fork of the gist from this blog post.

alexmoore / latency.txt
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
alexmoore / push.rb
Created Aug 31, 2012
[hg]|[git] push -m 'it real good'
View push.rb
require 'Win32API'
Beep ='kernel32', 'Beep', ['I', 'I'], 'I')
def Rest(ms)
sleep(ms / 1000.0)
c = 1046
d = 1175
e = 1319
alexmoore / vnode_helper.rb
Last active Dec 16, 2015
Little helper class to figure out on which vnodes a particular hash resides.
View vnode_helper.rb
class VNodeHelper
attr_reader :ring_size, :n_val
def initialize(ring_size, n_val)
@ring_size = ring_size
@n_val = n_val
@vnode_size = (2 ** 160 / @ring_size)
View public-access-bucket-policy.json
"Id": "Policy1371509616384",
"Statement": [
"Sid": "Stmt1371509665536",
"Action": [
"Effect": "Allow",
"Resource": "arn:aws:s3:::BUCKET_NAME/*",
function list_erlangs() {
read -ra AvailableErls <<< `ls -l $ERL_HOME | awk '/^d/' | cut -d ' ' -f12-`
Current=`ls -l $ERL_HOME | awk '/^l/' | sed 's/^l.*-> \(.*\)/\1/'`
for i in "${AvailableErls[@]}"; do
if [ $i = $Current ]; then echo "$Current *"; else echo $i; fi
function change_current_erlang() {
View fizzbuzz.erl
print_fizz_buzz() ->
Each = fun(I) ->
print_fizz_buzz(fizzbuzz(I)) end,
lists:foreach(Each, lists:seq(1,100)).
print_fizz_buzz(I) when is_integer(I) -> io:fwrite("~p~n", [I]);
print_fizz_buzz(I) -> io:fwrite("~s~n", [I]).
alexmoore / .emacs
Created Sep 30, 2013
Add this to your .emacs file to autoload the tools for the current erlang with
View .emacs
;; setup erlang mode
(setq erlang-root-dir "/Users/alex/erlangs/current")
(setq erlang-lib-dir (concat erlang-root-dir "/lib/erlang/lib"))
(setq load-path
(cons (concat erlang-lib-dir
(car (directory-files erlang-lib-dir nil "^tools\-"))
"/emacs" )