This file contains 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 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 has been truncated, but you can view the full file.
This file contains 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 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 contains 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
App.Storage = _.extend { Database: {} }, App.Storage | |
class App.Storage.Database.Statement | |
__error: (args...) -> | |
console.error args... | |
constructor: (@query, @args=[], @success=(->), @error=@__error) -> | |
This file contains 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
App.Storage = _.extend { Database: {} }, App.Storage | |
class App.Storage.Database.Statement | |
__error: (args...) -> | |
console.error args... | |
constructor: (@query, @args=[], @success=(->), @error=@__error) -> | |
This file contains 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
class Foo(object): | |
def __init__(self, **kwargs): | |
self.__attr = kwargs.pop('attr', None) | |
@property | |
def bar(self): | |
return self.__attr | |
def test_foo(): |
This file contains 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
/* | |
truncate text within HTML | |
does not work with malformed html | |
*/ | |
function html_truncate(elem, num_words, truncate_string) { | |
// local state | |
var original = elem, | |
current = elem.childNodes[0], | |
count = 0; |
This file contains 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
/** | |
* not so simple check for object equality | |
*/ | |
var equal = function(a, b) { | |
function check(a, b) { | |
for (var attr in a) { | |
if (a.hasOwnProperty(attr) && b.hasOwnProperty(attr)) { | |
if (a[attr] != b[attr]) { | |
switch (a[attr].constructor) { | |
case Object: |
This file contains 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
function detect(obj, attr, exact) { | |
var results = [], | |
re = new RegExp(attr, 'i'); | |
// helper function for the recursion | |
function detectHelper(obj, attr, exact, path, results) { | |
for (var a in obj) { | |
// sanity check | |
if (!obj.hasOwnProperty(a)) | |
continue; |
OlderNewer