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 | |
set -e | |
function test_funx { | |
r=0 | |
((r++)) | |
} | |
test_funx & | |
wait |
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/env python | |
""" | |
A pure python ping implementation using raw socket. | |
Note that ICMP messages can only be sent from processes running as root. | |
Derived from ping.c distributed in Linux's netkit. That code is |
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
exclusion_set = set(('input', 'output')) - set(data_i) | |
{> | |
(> if exclusion_set: | |
raise RuntimeError('missing keys: %s' % str(exclusion_set)) |
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
['app_name', 'method', 'type'].forEach ( function (item) { | |
if (!req.headers.hasOwnProperty(item)) { | |
throw { | |
etype : 'USER' | |
,ecode : 406 | |
,source : 'HTTP LOCAL ROUTE' | |
,info : 'MISSING ITEM [' + item + ']' | |
} | |
} |
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 | |
set -e | |
pipe_name="test_pipe" | |
# --------------------------------------------------------------------------- # |
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
""" | |
:module pbf2json: | |
-------------------------------------------------------------------------------- | |
License: Public Domain with no guarantees made | |
Date: 12/28/2012 | |
http://cjhanks.name | |
-------------------------------------------------------------------------------- | |
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 os = require ('os'); | |
for (var i in os) { | |
console . log ('-------------------------------------------------------------------'); | |
console . log (i); | |
console . log ((typeof os[i] === 'function') ? os[i]() : os[i]); | |
} |
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
Slot.prototype.poll = function () { | |
/* This polls infinitely for new work in the queue and if they become | |
* available properly routes the input into execution. | |
* | |
* Note that is very important to be careful to call semantics in this | |
* function to prevent stack overflow. | |
*/ | |
var self = this; | |
self['swf'].pollForActivityTask(self['aws_opts'], function (err, res) { |
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 | |
set -e | |
wget http://downloads.sourceforge.net/project/udt/udt/4.11/udt.sdk.4.11.tar.gz | |
tar xzvf udt.sdk.4.11.tar.gz | |
pushd udt4 | |
make |
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 json | |
class MetaJson(dict): | |
""" | |
Allows a dictionary to act as an object and be serializable to JSON. Used | |
for making JSON object behave like python objects. | |
""" | |
def __init__(self, d = dict()): | |
dict.__init__(self, | |
{k: MetaJson(v) if isinstance(v, dict) else v for (k, v) in d.items()} |