Skip to content

Instantly share code, notes, and snippets.

In [1]: int(True)
Out[1]: 1
In [2]: True == 1
Out[2]: True
@blinsay
blinsay / rancor.sh
Last active December 11, 2015 06:58
RANCOR
#!/bin/bash
echo "the rancor is coming do u hide? [Y/N/maybe]"
read hide
while [ "$hide" != "hide" ]
do
echo "y didn't u put the t-shirt on youre bewbs?"
done
@blinsay
blinsay / crawl_maxgif.py
Created November 30, 2012 07:06
GIVE ME ALL OF YOUR GIFS
#!/usr/bin/env python
import os
import sys
import requests
import argparse
from urlparse import urlparse
from time import ctime, sleep
from bs4 import BeautifulSoup
>>> {k2:{k1: d[k1][k2]} for k1 in d for k2 in d[k1]}
{'numbers': {'this': {'one': 1, 'two': 2}}}
@blinsay
blinsay / jade
Created August 7, 2012 17:17
C.J and GEM_PATH
benl@bivalve: jading$ ./jade -g json -g jruby-openssl -l /Users/benl/Projects/cascading.jruby/sandbox/lib /Users/benl/Projects/cascading.jruby/sandbox/{fuckery,sleep,external}.rb && yes | gem uninstall cascading.jruby
Ivy dependencies already resolved
Buildfile: /Users/benl/Projects/jading/build.xml
[echo] Resolved?: true
download-ivy:
init-ivy:
retrieve-ivy:
@blinsay
blinsay / gist:3232319
Created August 2, 2012 01:36
jruby whoops
benl@bivalve: jading$ hadoop jar jade.jar com.etsy.jading.Main fuckery.rb
Warning: $HADOOP_HOME is deprecated.
Aug 1, 2012 6:34:39 PM com.etsy.jading.Main run
INFO: Main.run() properties:
Aug 1, 2012 6:34:40 PM com.etsy.jading.Main run
INFO: JRUBY_HOME set to: /Users/benl/.rvm/rubies/jruby-1.6.5.1/
Aug 1, 2012 6:34:40 PM com.etsy.jading.Main run
INFO: cascading.jruby script ARGV:
Aug 1, 2012 6:34:41 PM com.etsy.jading.Main run
@blinsay
blinsay / gist:3218374
Created July 31, 2012 16:47
cascading.jruby test failures
1) Error:
test_create_union(TC_Aggregations):
NameError: no constructorfor arguments (cascading.flow.Scope) on Java::CascadingFlowPlanner::Scope
available overloads:
(java.lang.String)
(cascading.tuple.Fields)
(cascading.flow.planner.Scope)
/Users/benl/Projects/cascading.jruby/lib/cascading/scope.rb:10:in `copy'
/Users/benl/Projects/cascading.jruby/lib/cascading/assembly.rb:25:in `initialize'
/Users/benl/Projects/cascading.jruby/lib/cascading/assembly.rb:206:in `branch'
@blinsay
blinsay / HashJoinTest.java
Created June 26, 2012 21:13
HashJoin after Merge throwing an IllegalStateException
import java.io.IOException;
import org.junit.Test;
import cascading.PlatformTestCase;
import cascading.flow.Flow;
import cascading.flow.FlowDef;
import cascading.pipe.HashJoin;
import cascading.pipe.Merge;
import cascading.pipe.Pipe;
@blinsay
blinsay / gist:2322380
Created April 6, 2012 19:40
pycascading import error
$ ../local_run.sh word_count.py
*** this cp: ['/Users/benl/Projects/python/pycascading/python/pycascading', '/Users/benl/Projects/python/pycascading/python', '/usr/local/Cellar/jython/2.5.2/libexec/Lib', '__classpath__', '__pyclasspath__/', '/usr/local/Cellar/jython/2.5.2/libexec/Lib/site-packages', u'/usr/local/cascading-2.0.0-wip-262-hadoop-0.20.2+/cascading-core-2.0.0-wip-262.jar', u'/usr/local/cascading-2.0.0-wip-262-hadoop-0.20.2+/cascading-hadoop-2.0.0-wip-262.jar', '.', u'/usr/local', u'/usr/local/python', u'/usr/local/python/Lib']
Traceback (most recent call last):
File "../python/pycascading/bootstrap.py", line 83, in <module>
m = imp.load_source('main', sys.argv[2])
File "word_count.py", line 22, in <module>
from pycascading.helpers import *
File "/Users/benl/Projects/python/pycascading/python/pycascading/helpers.py", line 32, in <module>
from pycascading.decorators import *
File "/Users/benl/Projects/python/pycascading/python/pycascading/decorators.py", line 57, in <module>
$ git diff build.xml
diff --git a/java/build.xml b/java/build.xml
index 8aed339..519a84f 100644
--- a/java/build.xml
+++ b/java/build.xml
@@ -38,7 +38,7 @@
<path id="java.classpath">
<pathelement location="${build.classes}"/>
<path>
- <fileset dir="${cascading.home}" includes="cascading-core-*.jar" />