Skip to content

Instantly share code, notes, and snippets.

Anders Pearson thraxil

Block or report user

Report or block thraxil

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
View nginx.conf.jinja
{% set app='example' %}
upstream {{app}} {
{% if pillar.role == 'staging' %}
server {{app}}.stage.ccnmtl.columbia.edu.s3-website-us-east-1.amazonaws.com;
{% else %}
server {{app}}.ccnmtl.columbia.edu.s3-website-us-east-1.amazonaws.com;
{% endif %}
}
server {
View user.js
var requirejs = require('requirejs');
var jsdom = require('mocha-jsdom');
var assert = require('assert');
requirejs.config(require('../../config/test_config').options);
describe('models/user', function() {
jsdom();
// local operations on a model should be fast
@thraxil
thraxil / d173.sh
Created Jan 14, 2015
update all the apps
View d173.sh
#!/bin/bash
declare -a apps=("capsim" "carr" "ccdb" "countryx" "diabeaters" "dmt" "forest" "mediamachine" "mvsim" "nynjaetc" "plexus" "pump" "rolf" "smart_sa" "smilekit" "ssnm" "tala" "uelc" "wacep" "wardenclyffe" "worth2")
for app in "${apps[@]}"
do
echo "============== $app ==============="
cd $app
git checkout master
git pull
View prefixgroup.py
#!/usr/bin/env python
import os
import sys
class TrieNode(object):
def __init__(self):
self.children = dict()
self.count = 0
View watcher.py
import requests
from socket import socket
import time
URLS = [("wiki.", "http://wiki.ccnmtl.columbia.edu/"),
("jtsa.", "http://learn.jtsa.edu/"),
("polarhub.", "http://thepolarhub.org/"),
("edblogs.", "http://edblogs.columbia.edu/"),
]
CARBON_HOST = "nanny.cul.columbia.edu"
View gist:0016e65a74b4bec50c8e
#!/bin/bash
for app in `echo */`; do
echo $app
cd $app
git pull
perl -pi -e 's/Django==1.6.4/Django==1.6.5/' requirements.txt
make && git commit -a -m "Django -> 1.6.5" && git push
cd ..
done
View gist:9159008
// A
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
goto fail
goto fail
}
// B
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0) {
goto fail
}
View gist:9158987
# A
if some_condition:
goto fail
goto fail
# B
if some_condition:
goto fail
goto fail
View gist:9158966
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
View gist:9158946
if ((err = SSLHashSHA1.update(&hashCtx, &signedParams)) != 0)
goto fail;
goto fail;
You can’t perform that action at this time.