Skip to content

Instantly share code, notes, and snippets.

@tshddx
tshddx / preferred_numbers.rb
Created July 30, 2015 21:51
Preferred number generator
# https://en.wikipedia.org/wiki/Preferred_number
def preferred_numbers(x, precision=2)
root = 10 ** (1 / x.to_f)
return x.times.map {|i| (root ** i).round(precision)}
end
<<EXAMPLES
> preferred_numbers(2)
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#