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
(ns test-kafka.core | |
(:gen-class) | |
(:require [clj-kafka.consumer.zk :refer :all] | |
[clj-kafka.core :refer :all] | |
[msgpack.core :refer :all])) | |
(def config {"zookeeper.connect" "zk04/cb/kafka/pingqueue" | |
"group.id" "clj-kafka.consumer" | |
"auto.offset.reset" "smallest" | |
"auto.commit.enable" "false"}) |
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
db.getCollectionNames().filter(function(col){return db[col].getIndexes().filter(function(idx){return idx.unique}).length}) |
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
ps aux | grep FOOBARBAZ | tr -s ' ' | cut -d' ' -f2 | xargs kill -9 |
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
$ python -m timeit -s 'from collections import namedtuple; NT = namedtuple("NT", "a"); nt = NT(1)' 'nt.a' | |
10000000 loops, best of 3: 0.138 usec per loop | |
/U/d/chartbeat(dev)(master)$ python -m timeit -s 'd = (1, )' 'd[0]' | |
10000000 loops, best of 3: 0.0409 usec per loop | |
/U/d/chartbeat(dev)(master)$ python -m timeit -s 'd = {"a": 1}' 'd["a"]' | |
10000000 loops, best of 3: 0.0358 usec per loop |
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
s3cmd ls s3://S3_BUCKET | grep PATTERN | tr -s ' ' | cut -d' ' -f4- | xargs s3cmd get |
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
ps aux --sort -pmem | head |
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
ps aux # get the pid | |
netstat -tulpn | grep PID |
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
javascript:(function()%7Bvar name%3Dprompt(%27Enter a name%27)%3B%24(%27%23team-grid li h3%27).each(function()%7Bif(!%24(this).html().match(new RegExp(name,%27i%27)))%7B%24(this).parent().parent().parent().toggleClass(%27dim%27)%7D%7D)%7D)()%3B |
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 main(): | |
""" | |
[debug-only] | |
""" | |
define("domain", default="theverge.com") | |
define("path", default=None) | |
define("console", default=True, type=bool) | |
define("debug", default=True, type=bool) | |
define("click_through_host", default="localhost") | |
define("minutes", default=5) |
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
[ [43/1951] | |
{ | |
"_id" : { | |
"t" : ISODate("2014-04-14T13:48:07Z"), | |
"vh" : BinData(0,"SK9o5qTZfIsFvOsRRPMrvA=="), | |
"ph" : BinData(0,"HC+s0NvoJhAjtxUDTpI9bQ==") | |
}, | |
"vaup" : { | |
"auto" : 0, | |
"unkn" : 1, |