This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@print: -> | |
console.log '[DEBUG]', arguments... if DEBUG | |
return |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A | |
a | |
aa | |
aal | |
aalii | |
aam | |
Aani | |
aardvark | |
aardwolf | |
Aaron |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Lines of code" $( | |
find enki -name \*.html -o -name \*.css -o -name \*.js -o -name \*.coffee -o -name \*.py \ | |
| grep -vE "/migrations/" \ | |
| grep -vE "enki/static/admin" \ | |
| grep -vE "enki/static/CACHE" \ | |
| grep -vE "enki/static/css/lib" \ | |
| grep -vE "enki/static/css/mobile" \ | |
| grep -vE "enki/static/js/lib" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj b/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj | |
index 28b9202..9e10fab 100644 | |
--- a/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj | |
+++ b/storm-core/src/clj/backtype/storm/scheduler/EvenScheduler.clj | |
@@ -22,15 +22,16 @@ | |
:implements [backtype.storm.scheduler.IScheduler])) | |
(defn sort-slots [all-slots] | |
- (let [split-up (vals (group-by first all-slots))] | |
- (apply interleave-all split-up) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_recipe "python" | |
include_recipe "sudo" | |
package "htop" | |
package "tree" | |
package "libcurl3" | |
package "fail2ban" | |
package "unattended-upgrades" | |
package "logwatch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def partiton(collection, size): | |
return zip(*[iter(collection)]*size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lst = [2, 2, 3, -5] | |
from itertools import * | |
[m[1] for m in zip(chain(*[combinations(lst, n) for n in range(1,len(lst)+1)]), chain(*[combinations(range(len(lst)), n) for n in range(1,len(lst)+1)])) if sum(m[0]) == 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/requirements.txt b/requirements.txt | |
index 4adaf3c..3395e1b 100644 | |
--- a/requirements.txt | |
+++ b/requirements.txt | |
@@ -40,3 +40,4 @@ pytz | |
http://cairographics.org/releases/py2cairo-1.8.10.tar.gz | |
git+git://github.com/graphite-project/whisper.git#egg=whisper | |
raven==3.2.1 | |
+ds==0.8.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parse the query string portion of a string containing a URI or URL. | |
*/ | |
def parseUri(uri: String): Map[String, Seq[String]] = { | |
var params = collection.mutable.HashMap[String, Seq[String]]() | |
val parts = uri split "\\?" | |
if (parts.length > 1) { | |
val query = parts(1) | |
for (param <- query split "&") { | |
val pair = param split "=" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def diff_dict(d1, d2): | |
""" | |
Determine which keys have changed between two dictionaries | |
""" | |
def diff(d1, d2, r): | |
for k in d1: | |
if k not in d2: | |
r[k] = d1[k] | |
elif d1[k] != d2[k]: | |
if issubclass(d2[k].__class__, dict): |