Skip to content

Instantly share code, notes, and snippets.

View mmar's full-sized avatar
🐈‍⬛

Matusalem Marques mmar

🐈‍⬛
View GitHub Profile
@mmar
mmar / gist:284968
Created January 24, 2010 02:27
Tweet a fortune
# Use .netrc for credentials. See netrc(5) manpage for format.
echo status=“`fortune -n 138 -s`” | curl -n -d @- https://api.twitter.com/1/statuses/update.json >& /dev/null
@mmar
mmar / CompassHeading.rb
Last active August 7, 2022 03:33
Converting degrees to compass heading
class Fixnum
def degrees_to_compass
%w( N NNE NE ENE E ESE SE SSE S SSW SW WSW W WNW NW NNW )[((self+11.25).modulo(360)/22.5).floor]
end
end