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
| require "openssl" | |
| require "digest" | |
| def aes128_cbc_encrypt(key, data, iv) | |
| key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
| iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize) | |
| aes = OpenSSL::Cipher.new('AES-128-CBC') | |
| aes.encrypt | |
| aes.key = key | |
| aes.iv = iv |
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 scaffolded edit view converted to mustache --> | |
| <h1>Editing post</h1> | |
| {{#form}} | |
| {{#errors?}} | |
| <div id="error_explanation"> | |
| <h2>{{error_header}}</h2> | |
| </div> | |
| <ul> |
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
| { | |
| "text": "RT @PostGradProblem: In preparation for the NFL lockout, I will be spending twice as much time analyzing my fantasy baseball team during ...", | |
| "truncated": true, | |
| "in_reply_to_user_id": null, | |
| "in_reply_to_status_id": null, | |
| "favorited": false, | |
| "source": "<a href=\"http://twitter.com/\" rel=\"nofollow\">Twitter for iPhone</a>", | |
| "in_reply_to_screen_name": null, | |
| "in_reply_to_status_id_str": null, | |
| "id_str": "54691802283900928", |
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
| from redis import Redis | |
| import simplejson | |
| class Resque(object): | |
| """Dirt simple Resque client in Python. Can be used to create jobs.""" | |
| redis_server = 'localhost:6379' | |
| def __init__(self): | |
| host, port = self.redis_server.split(':') | |
| self.redis = Redis(host=host, port=int(port)) |
NewerOlder