Skip to content

Instantly share code, notes, and snippets.

View saml's full-sized avatar

Sam Lee saml

  • New York, NY
View GitHub Profile
/*
Goal:
{
"portions": [{
"price": "$1"
}]
}
==> MenuItem(List(MenuItemPortion("$1")))
let
a = b
c = d
in
a c

At PyCon, two (male) friends were talking privately. One of them made a joke comparing "big dongles" to a phallus. Their photo appeared all over Twitter with allegations of sexism and one of the men was fired soon after. He now has a wife, three kids, and a tarnished reputation.

Adria Richards used her soapbox as a developer evangelist at SendGrid to spread a covertly-taken photo to her thousands of Twitter followers (http://imgur.com/aiXK5SU is the first in a series; the "forking" reference turned out to be a fabrication). She never exchanged a word with the men.

From the response online it appears that most are in agreement that a phallus joke is immature but not sexist. The fact that it was a private conversation between two friends should make this even more clear.

In fact, the next day she made a phallus joke herself (http://imgur.com/7XGY8wB). This suggests that her motivations may be questionable.

This is hugely damaging to the community for a number of reasons:

  1. Anyone can post a photo of you an
@saml
saml / logger.xml
Last active December 15, 2015 05:59
playframework logger
<configuration>
<!-- this is plain logback config.
documentation: http://logback.qos.ch/manual/appenders.html
set -Dlogger.level like this:
/usr/java/latest/bin/java -Dconfig.file=/apps/YOURAPP/conf/application.conf -cp /apps/YOURAPP/staged/* -Dlogger.level=WARN play.core.server.NettyServer /apps/YOURAPP
-->
@saml
saml / alt_completion.pl
Last active December 15, 2015 06:29
xchat tab completion for flowdock
# puts @ in front of nick for tab completion. for flowdock.com
# originally from: https://xchat.svn.sourceforge.net/svnroot/xchat/plugins/perl/alt_completion.pl
# to install, put this file under ~/.xchat2/
use strict;
use warnings;
use Xchat ();
use File::Spec ();
use File::Basename qw(fileparse);
#define COLOR_STYLE ZENBURN_DARK
#define COMMAND_EXEC_PROGRAM TRUE
#define COMMAND_FONT TRUE
#define COMMAND_SHOW_HELP TRUE
#define COMMAND_SHOW_OPTIONS TRUE
#define COMMAND_SHOW_VERSION TRUE
#define FONT "Monospace 14"
#define FONT_ANTI_ALIAS TRUE
#define SCROLL_LINES 100000
#define SCROLLBAR RIGHT
@saml
saml / tzconvert.py
Last active December 16, 2015 01:49
# pip install dateutil pytz
import dateutil.parser
import pytz
import traceback
while True:
try:
line = raw_input("> ").strip()
import re
NON_WORD = re.compile(r'\W+')
target = '55 w. 45th st.'
candidates = [
'11 park pl | btwn broadway & church st ',
'217 e 86th st | at 3rd ave ',
'2 e 33rd st | at 5th ave ',
"23 3rd ave | btwn st mark's pl & stuyvesant st",
int f(int x, int y) {
for (; x >= cutoff; x--) {
y = (y <= 0) ? 1 : f(x, y - 1);
}
return g(x,y);
}