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
Spine = require('spine') | |
Milk = require('milk/milk') | |
$ = Spine.$ | |
class Payforms extends Spine.Controller | |
constructor: -> | |
super | |
@current = null | |
# include view is here!!!! |
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
Spine = require('spine') | |
Milk = require('milk/milk') | |
$ = Spine.$ | |
Ticket = require('models/ticket') | |
class Payforms extends Spine.Controller | |
constructor: -> | |
super | |
@current = null |
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
data = [1,2,3,4,5] | |
# take x if not divided to 2 | |
result = [ x for x in data if x % 2 ] | |
# take x * 2 if result not divided 3 | |
result = [ x * 2 for x in result if (x * 2) % 3 ] |
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
BeautifulSoup==3.2.1 | |
Chameleon==2.7.3 | |
CherryPy==3.2.2 | |
Django==1.3.1 | |
Jinja2==2.6 | |
Mako==0.6.2 | |
MarkupSafe==0.15 | |
Paste==1.7.5.1 | |
PasteDeploy==1.5.0 | |
PasteScript==1.7.4.2 |
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 A(): | |
def __init__(self): | |
self._label() | |
def _label(self): | |
self.show("A::_label") | |
def show(self, msg): | |
print msg |
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
>>> t =json.dumps({'k1':1, 'k2':[1,2,3], 'k3':'blah', 'k4': None}) | |
>>> t | |
'{"k3": "blah", "k2": [1, 2, 3], "k1": 1, "k4": null}' | |
>>> json.loads(t) | |
{u'k3': u'blah', u'k2': [1, 2, 3], u'k1': 1, u'k4': None} | |
>>> con.hmset("test:hm", {'t':t}) | |
True | |
>>> v=con.hmget("test:hm", 't') | |
>>> v | |
['{"k3": "blah", "k2": [1, 2, 3], "k1": 1, "k4": null}'] |
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
from random import choice | |
import string | |
def genpass(length=16, chars=string.letters+string.digits): | |
return ''.join(choice(chars) for i in xrange(length)) | |
if '__main__' == __name__: | |
print genpass() |
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 subprocess | |
cmd = ["notify-send", "--hint=int:transient:1", '"Hello"', "-i", "/home/roman/multimedia/img/avatar_100x100_lj.jpg"] | |
subprocess.call(cmd) |
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
#include <stdio.h> | |
#include "class_a.h" | |
A::A(void) { | |
} | |
A::~A(void) { | |
} |
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
src = [{"id":1, "value":2}, {"id":3, "value":4}] | |
tmp_list = [] | |
for item in src: | |
tmp_list.append({"id": item["id"], "value": item["value"]}) | |
result = tuple(tmp_list) |
OlderNewer