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
# pyres/failure/redis.py | |
@classmethod | |
def all(cls, resq, start=0, count=1): | |
items = resq.redis.lrange('resque:failed', start, count) or [] | |
ret_list = [] | |
for i in items: | |
failure = ResQ.decode(i) | |
failure['redis_value'] = base64.b64encode(i) | |
ret_list.append(failure) |
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
# pyres ResQ list_range | |
def list_range(self, key, start, count, decode=True): | |
items = self.redis.lrange(key, start,start+count-1) or [] | |
ret_list = [] | |
for i in items: | |
if decode: i = ResQ.decode(i) | |
ret_list.append(i) | |
return ret_list |
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
/* adapted by Jed Schmidt for use as a node.js module. | |
* the following node.js adapter code is MIT-licensed. | |
* | |
* Example usage: | |
* | |
* var sha1 = require("sha1.js"), hash; | |
* | |
* my_sha1 = sha1.hex( data ); | |
* my_hmac_sha1 = sha1.hex( key, data ); | |
* |
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
# Config for Nginx to act as a front-end for Riak | |
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc) | |
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_) | |
# Config is in /etc/nginx/sites-available/default or somewhere like that | |
# Set up load-balancing to send requests to all nodes in the Riak cluster | |
# Replace these IPs/ports with the locations of your Riak nodes | |
upstream riak_hosts { | |
server 127.0.0.1:8098; |
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
[67/67] cxx_link: build/default/src/node_4.o build/default/src/node_buffer_4.o build/default/src/node_http_parser_4.o build/default/src/node_net2_4.o build/default/src/node_io_watcher_4.o build/default/src/node_child_process_4.o build/default/src/node_constants_4.o build/default/src/node_cares_4.o build/default/src/node_events_4.o build/default/src/node_file_4.o build/default/src/node_signal_watcher_4.o build/default/src/node_stat_watcher_4.o build/default/src/node_stdio_4.o build/default/src/node_timer_4.o build/default/src/node_script_4.o build/default/src/node_crypto_4.o build/default/deps/c-ares/ares_expand_string_1.o build/default/deps/c-ares/ares_library_init_1.o build/default/deps/c-ares/ares_destroy_1.o build/default/deps/c-ares/ares_mkquery_1.o build/default/deps/c-ares/ares_options_1.o build/default/deps/c-ares/ares_cancel_1.o build/default/deps/c-ares/ares_parse_aaaa_reply_1.o build/default/deps/c-ares/ares_process_1.o build/default/deps/c-ares/ares_free_string_1.o build/default/deps/c-ares/ares_pa |
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
[66/66] cxx_link: build/default/src/node_4.o build/default/src/node_buffer_4.o build/default/src/node_http_parser_4.o build/default/src/node_net2_4.o build/default/src/node_io_watcher_4.o build/default/src/node_child_process_4.o build/default/src/node_constants_4.o build/default/src/node_cares_4.o build/default/src/node_events_4.o build/default/src/node_file_4.o build/default/src/node_signal_watcher_4.o build/default/src/node_stat_watcher_4.o build/default/src/node_stdio_4.o build/default/src/node_timer_4.o build/default/src/node_script_4.o build/default/deps/c-ares/ares_expand_string_1.o build/default/deps/c-ares/ares_library_init_1.o build/default/deps/c-ares/ares_destroy_1.o build/default/deps/c-ares/ares_mkquery_1.o build/default/deps/c-ares/ares_options_1.o build/default/deps/c-ares/ares_cancel_1.o build/default/deps/c-ares/ares_parse_aaaa_reply_1.o build/default/deps/c-ares/ares_process_1.o build/default/deps/c-ares/ares_free_string_1.o build/default/deps/c-ares/ares_parse_srv_reply_1.o build/default/de |
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
# Redis transactions demonstration. | |
# See the following thread on the Redis mailing list for background: | |
# http://groups.google.com/group/redis-db/browse_thread/thread/8a981b3fd76f8f41 | |
# Output is included in comments below the code. | |
import redis | |
def do(r): | |
r.watch('mykey1') | |
txn = r.pipeline() |
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
select | |
eventsAggregate.publicationId, | |
eventsAggregate.userId, | |
eventsAggregate.deviceModel, | |
eventsAggregate.eventType, | |
eventsAggregate.eventDate, | |
to_date(subs.activationTime) as activationDate, | |
datediff(eventsAggregate.eventDate, to_date(subs.activationTime)) as eventDay, | |
eventsAggregate.count | |
from ( |
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
### Keybase proof | |
I hereby claim: | |
* I am mjrusso on github. | |
* I am mjrusso (https://keybase.io/mjrusso) on keybase. | |
* I have a public key whose fingerprint is C64C 76BF 297F 6C1F DEC8 76D5 B3EF 65A8 D05F 2580 | |
To claim this, I am signing this 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
import UIKit | |
import ImageCaptureCore | |
import MobileCoreServices | |
class ViewController: UIViewController { | |
var deviceFinder = DeviceFinder() | |
override func viewDidLoad() { | |
super.viewDidLoad() |
OlderNewer