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
inspect = (o) -> | |
alert(JSON.stringify(o)) | |
# GWT-style module injection | |
class Module | |
constructor: (m) -> | |
@extend(m) | |
extend: (m) -> | |
for k, v of m |
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
var template = function(ctx, tpl) { | |
var accum = [], idx = 0; | |
while (true) { | |
var start = tpl.indexOf('{{', idx); | |
if (start < 0) break; | |
var end = tpl.indexOf('}}', start); | |
if (end < 0) break; | |
var str = tpl.slice(start+2, end); |
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 piston.handler import BaseHandler | |
from models import Apple | |
class AppleHandler(BaseHandler): | |
exclude = () # Ensure that the ID is shown. | |
allowed_methods = ('GET', 'POST', 'PUT', 'DELETE') | |
model = Apple |
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 gevent | |
from gevent.event import AsyncResult | |
import gevent.pool | |
import gevent.queue | |
class WorkerQueue(object): | |
def __init__(self): | |
self.group = gevent.pool.Group() | |
self.q = gevent.queue.Queue() |
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
#!/bin/bash | |
# USAGE: | |
# captive-network <setup|pingall|xterms|restart|teardown> | |
# | |
# captive-network setup create the topology | |
# captive-network pingall check connectivity between nodes | |
# captive-network xterms launch one terminal per node | |
# captive-network restart delete and recreate the topology | |
# captive-network teardown delete the topology |
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
#!/usr/bin/python | |
import smtplib | |
import dns.resolver | |
def get_mx_records(domain): | |
try: | |
records = dns.resolver.query(domain, "MX") | |
preferred = sorted(records, key=lambda r: r.preference) |
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
diff --git a/sql/functions/apply_constraints.sql b/sql/functions/apply_constraints.sql | |
index 4afaa83..c0c5303 100644 | |
--- a/sql/functions/apply_constraints.sql | |
+++ b/sql/functions/apply_constraints.sql | |
@@ -3,6 +3,7 @@ | |
*/ | |
CREATE FUNCTION apply_constraints(p_parent_table text, p_child_table text DEFAULT NULL, p_analyze boolean DEFAULT TRUE, p_debug boolean DEFAULT FALSE) RETURNS void | |
LANGUAGE plpgsql | |
+ SET timezone = 'UTC' | |
AS $$ |
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
# Maintainer: Artem Grunichev <[email protected]> | |
# Contributor: Brendan MacDonell <[email protected]> | |
pkgname=xfstk | |
pkgver=1.7.3 | |
pkgrel=2 | |
pkgdesc="Updater for Intel SoC firmware over USB using the DNX protocol" | |
arch=('i686' 'x86_64') | |
url="http://xfstk.sourceforge.net" | |
license=('LGPL') |
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
#!/bin/sh -eux | |
iface=lo | |
host=127.0.0.1/32 | |
port=80 | |
netem_rule="delay 150ms 10ms loss 0.5%" | |
upstream_rule="rate 500kbit" | |
downstream_rule="rate 2mbit" | |
upstream=1:11 |
OlderNewer