Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Mathes benmathes

View GitHub Profile
@benmathes
benmathes / dice_converter.rb
Last active Sep 29, 2016
n-sided dice to m-sided dice
View dice_converter.rb
# rand(n) is a random number 0-(n-1)
# e.g. [1,0,0] => 4
def bit_array_to_integer(bit_array)
return bit_array.join.to_i(2)
end
@benmathes
benmathes / gist:1ed7c90934df0bd21774
Last active Jan 5, 2016
Unsolicited Thoughts for the Young Men of San Francisco
View gist:1ed7c90934df0bd21774
The sooner you’re comfortable dressing up to look like you didn't try that hard to look cool, the better.
If your friends aren’t surprised by one of your political affiliations then you’re too predictable.
If you're not already, become friends with a housing-rights activist.
Know enough about wine that you’re comfortable speak to a sommelier.
Know enough about weed that you're comfortable talking to the truffle guy in Dolores Park.
Don't learn to drive a stick shift on the SF hills.
Don’t frequent strip clubs.
Pay for her Uber home.
The best articles on twitter are not from news outlets.
Never wear activewear outside The Marina or Cow Hollow unless you are actually exercising or on your way to.
View gist:20c57e0487cb9c9db2f3
The sooner you’re comfortable dressing up to look like you didn't try that hard to look cool, the better.
If you’re friends aren’t surprised by one of your political affiliations then you’re too predictable.
If you’re not already, become friends with a housing-rights activist.
Know enough about wine that you’re comfortable speak to a sommelier.
Know enough about weed that you're comfortable talking to the truffle guy in Dolores Park.
Don't drive a stick shift.
Don’t frequent strip clubs.
If you’re useful in the kitchen you might be able to make rent.
Pay for her Uber home.
That’s not a beanie is it?
View gist:c740362dcdf08a040726
Verifying that +benmathes is my openname (Bitcoin username). https://onename.io/benmathes
View keybase.md

Keybase proof

I hereby claim:

  • I am benmathes on github.
  • I am bmath (https://keybase.io/bmath) on keybase.
  • I have a public key whose fingerprint is 8683 60B4 3984 CAFC 7C74 0864 D4A3 2DBF 9C2C DAC8

To claim this, I am signing this object:

@benmathes
benmathes / gist:7151836
Created Oct 25, 2013
Speed up your time on the command line
View gist:7151836
# first, find out which commands you use the most:
cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30
# example output:
95 cd
63 bundle
40 exit
@benmathes
benmathes / bye_bye_battletoads
Created Feb 28, 2013
Outgoing Groupon CEO's statement, wherein he references Battletoads and wins my heart.
View bye_bye_battletoads
Full text of his statement:
(This is for Groupon employees, but I’m posting it publicly since it will leak anyway)
People of Groupon,
After four and a half intense and wonderful years as CEO of Groupon, I’ve decided that I’d
like to spend more time with my family. Just kidding – I was fired today. If you’re wondering
why… you haven’t been paying attention. From controversial metrics in our S1 to our material
weakness to two quarters of missing our own expectations and a stock price that’s hovering
around one quarter of our listing price, the events of the last year and a half speak for
You can’t perform that action at this time.