Skip to content

Instantly share code, notes, and snippets.

View alivesay's full-sized avatar

Andrew Livesay alivesay

View GitHub Profile
@alivesay
alivesay / gist:3492003
Created August 27, 2012 20:29
How to disconnect w/ Twisted cleanly?
from twisted.internet import protocol, reactor
from twisted.words.protocols import irc
from twisted.internet.endpoints import TCP4ClientEndpoint
class TestProtocol(irc.IRCClient):
nickname = 'test098765'
def signedOn(self):
@alivesay
alivesay / gist:3784719
Created September 25, 2012 21:56
Taco Tech
The upper edge of the tortilla is then turned in to form the end wall of FIG. 1 and the lower edge of the tortilla is similarly turned in to form the lower end wall of FIG. 9, thereby closing off the ends of the chamber to completely enclose the food filler. The temporary fastener is then inserted through the tortilla product as described above.
At this point, the tortilla still retains its highly pliable, soft state and would quickly fall apart if one attempted to lift it by the exposed portion of the stick. However, the product is then cooked in a manner to cause the tortilla to obtain a semi-rigid, self-sustaining state. In that state, the tortilla is not as crisp as a cooked taco shell, for example, but is in an intermediate state of hardness between a cooked taco shell and the original, soft, pliable tortilla. It can be described as having a hardness similar to that of a crescent roll, for want of a better description.
f = File.read(ARGV[0])
puts f.unpack("C*").map{|i| i.to_s(2).rjust(8,"0")}.join(" ")
16c16
< background: #cdeaf6;
---
> background-color: #eeeeee;
22c22,24
< #button_continue, #button_native {
---
> .hero-unit h1 { font-size: 1.5em; }
>
> #button_continue, #button_native, #button_new {
Soon-to-be-deprecated ActiveRecord calls
Methods such as find(:all), find(:first), finds with conditions, and the :joins option will soon be deprecated.
More information: http://m.onkey.org/2010/1/22/active-record-query-interface
The culprits:
- app/helpers/application_helper.rb
- app/controllers/offers_controller.rb
- app/controllers/questions_controller.rb
- app/controllers/admin_controller.rb
- app/controllers/votes_controller.rb
Given this: http://jsfiddle.net/zZKHC/
Why doesn't the first ui-test element get processed by ng-transclude?
<body>
<div ng-app="myApp" class="ng-scope">
<div class="n0">ntimes test</div>
<div class="n1">ntimes test</div>
<div class="n2">ntimes test</div>
<div class="n3">ntimes test</div>
remote: /data/github/current/lib/github/config.rb:2047:in `backup_worker?': cannot load such file -- github/backups (LoadError)
remote: from /data/github/current/lib/github/config/resque.rb:66:in `<top (required)>'
remote: from /data/github/current/lib/rock_queue.rb:9:in `require'
remote: from /data/github/current/lib/rock_queue.rb:9:in `<top (required)>'
remote: from hooks/post-receive.rb:41:in `require'
remote: from hooks/post-receive.rb:41:in `<main>'
#!/bin/bash
GOOGLE_SL="ru"
GOOGLE_TL="en"
GOOGLE_TRANSLATE_URL="http://translate.google.com/translate_a/t?client=t&hl=en&sl=$GOOGLE_SL&tl=$GOOGLE_TL&ie=UTF-8&oe=UTF-8&multires=1&prev=btn&ssel=0&tsel=0&sc=1"
TESSERACT_LANG="rus"
TEMPFILE=$(mktemp)
@alivesay
alivesay / gist:6034533
Created July 19, 2013 01:59
minimal python to extract json value from stdin
import json
import sys
if __name__ == "__main__":
data = json.loads(sys.stdin.read())
print data[sys.argv[1]]
SELECT
count(*)
FROM
public.location_group
WHERE
port_number = $1
AND (
(