Skip to content

Instantly share code, notes, and snippets.

⚔️
Load average: 233.0

Alphadelta14

⚔️
Load average: 233.0
  • AlphaServ Computing Solutions
  • Massachusetts, USA
Block or report user

Report or block Alphadelta14

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Alphadelta14
Alphadelta14 / setup.py
Created Aug 25, 2015
Working alternate install location
View setup.py
from setuptools.command.install import install
from setuptools import setup
class root_usr_install(install):
prefix = '/local'
def __init__(self, *args, **kwargs):
install.__init__(self, *args, **kwargs)
View collections.js
// `mongo 127.0.0.1/MMApp collections.js`
function size(size) {
var unit, res, factor=1;
['B', 'KB', 'MB', 'GB', 'TB'].every(function(unit_) {
factor_ = factor*1024;
res = size/factor_;
unit = unit_;
if(isNaN(res) || res < 1) {
return false;
View Catchrate Lists
In [4]: sorted([(p.personal.catchrate, p.natid) for p in pokemon])
Out[4]:
[(0, 0),
(3, 144),
(3, 145),
(3, 146),
(3, 150),
(3, 243),
(3, 244),
(3, 245),
@Alphadelta14
Alphadelta14 / product.js
Created Aug 22, 2015
Node.JS Sugar Cartesian Product
View product.js
require('sugar');
export.product = function(){
var pools = Array.create(arguments);
return pools.reduce(function(accumulated, next){
return accumulated.map(function(prefix){
return next.map(function(suffix){
return prefix.concat([suffix]);
View input.js
var myAnonymous = (b, c) => b*c;
function makeSummer(a, b=2, c=3){
return (a) => a+b+c;
}
function listPrinter(...d){
console.log(d);
}
View stdout
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
<localhost> REMOTE_MODULE setup
ok: [localhost]
TASK: [mylib | Test library out] **********************************************
<localhost> REMOTE_MODULE testlib something=else hello=world
ok: [localhost] => {"argv": ["/home/alpha/.ansible/tmp/ansible-tmp-1472124073.82-220477884547431/testlib", "/home/alpha/.ansible/tmp/ansible-tmp-1472124073.82-220477884547431/arguments"], "data": "something=else hello=world "}
View docker run.man
DOCKER(1) JUNE 2014 DOCKER(1)
NAME
docker-run - Run a command in a new container
SYNOPSIS
docker run [-a|--attach[=[]]] [--add-host[=[]]]
[--blkio-weight[=[BLKIO-WEIGHT]]] [--blkio-weight-device[=[]]]
[--cpu-shares[=0]] [--cap-add[=[]]] [--cap-drop[=[]]]
[--cgroup-parent[=CGROUP-PATH]] [--cidfile[=CIDFILE]] [--cpu-period[=0]]
View test_argpasser.py
def test_parseable():
parser = ArgumentPasserParser()
parser.add_optional_bool('-n')
parser.add_optional_bool('--rm')
parser.add_optional_bool('--detach')
parser.add_optional_bool('--interactive')
parser.add_argument('image')
parser.add_argument('command', nargs=argparse.REMAINDER)
args = parser.parse_args(['--interactive',
View flow1.py
def main():
if product_one_env():
build = build_one()
deploy = deploy_one(build)
run_one(deploy, build)
elif product_two_env():
build = build_two()
deploy = deploy_two(build)
run_two(deploy, build)
You can’t perform that action at this time.