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
| /** | |
| * ListController | |
| * | |
| * @description :: Server-side logic for managing lists | |
| * @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers | |
| */ | |
| import _ from 'lodash'; | |
| class AsyncController { |
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
| [alias] | |
| st = status | |
| ci = commit | |
| co = checkout | |
| br = branch | |
| d = diff | |
| dc = diff --cached | |
| lg = log -p | |
| lol = log --graph --decorate --pretty=oneline --abbrev-commit | |
| lola = log --graph --decorate --pretty=oneline --abbrev-commit --all |
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 twisted.internet.defer import DeferredQueue | |
| class PubSub(object): | |
| def __init__(self): | |
| self.queues = [] | |
| def subscribe(self, queue=None): | |
| if queue is None: |
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
| [ui] | |
| username = Andrew Grigorev <[email protected]> | |
| [extensions] | |
| color = | |
| pager = | |
| [alias] | |
| lol = log -G --template '{label("log.changeset", "{node|short}")} {desc|firstline}' | |
| lg = log --patch --template '{label("log.changeset", "{node}")}\n{label("log.author", "Author: {author}")}\n{label("log.date", "Date: {date|date}\n\t{firstline}")}\n' |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import time | |
| import sys | |
| import threading | |
| import tornado.web | |
| import tornado.ioloop | |
| import tornado.gen | |
| from functools import partial | |
| from tornado.log import app_log as log |
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 twisted.internet task, reactor, defer | |
| def sleep(delay): | |
| return task.deferLater(reactor, delay, lambda: None) | |
| def sleep(delay): | |
| d = defer.Deferred() | |
| reactor.callLater(delay, d.callback, None) |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import logging | |
| import os | |
| import sys | |
| import git | |
| log = logging.getLogger(__name__) |
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 os import fork | |
| print fork() | |
| # clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=...) |
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 Conntrack import ConnectionManager, NFCT_O_XML | |
| from lxml.etree import fromstring | |
| def filter_nat(xml): | |
| d = fromstring(xml) | |
| orig_src = d.xpath("..//meta[@direction='original']/layer3/src/text()")[0] | |
| repl_dst = d.xpath("..//meta[@direction='reply']/layer3/dst/text()")[0] | |
| return orig_src != repl_dst |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # the default py2.7 print doesn't accept 'file' argument | |
| from __future__ import print_function | |
| import sys | |
| from redis import Redis |