Skip to content

Instantly share code, notes, and snippets.

View gsmcwhirter's full-sized avatar

Gregory McWhirter gsmcwhirter

View GitHub Profile
[["Content-Type","text/html; charset=utf-8"],["Content-Length",5230],["Set-Cookie","connect.sid=7dbb34fca3f070aac33cf2c111ef.bcba442beded9890dd246964cfa5e980; path=/; httpOnly; expires=Wed, 15 Sep 2010 22:48:32 GMT"]]
@gsmcwhirter
gsmcwhirter / aliases.py
Created July 5, 2017 17:11 — forked from sampsyo/aliases.py
hack for argparse adding subcommand aliases
#!/usr/bin/env python
"""Aliases for argparse positional arguments."""
import argparse
class AliasedSubParsersAction(argparse._SubParsersAction):
class _AliasedPseudoAction(argparse.Action):
def __init__(self, name, aliases, help):
int n = 2;
int count = 1;
while (count < 5)
{
count *= n;
if (count / 2 < 2)
{
System.out.println("Hello");
}
public String mystery(String str)
{
int i = 0;
while (i < str.length())
{
if (str.substring(i,i+1).equals("c"))
{
str = str.substring(0,i) + str.substring(i+1);
}
i++;
public int mystery(int n)
{
int a = 0, b = 1;
while (n > 0)
{
n--;
b = b+a;
a = b-a;
if ((a + b) % 13 == 0)
public void mystery(int n)
{
while ( n > 1)
{
if (n % 2 == 0){
n /= 2;
}
else {
n = 3 * n + 1;
//Snip from build
require.alias("forbeslindesay-booting-sub-nav/index.js", "dynamics-visualization/deps/booting-sub-nav/index.js");
require.alias("forbeslindesay-booting-sub-nav/scroll.js", "dynamics-visualization/deps/booting-sub-nav/scroll.js");
def my_decorator(klass):
old_run = klass.run
def wrapper():
def new_run(self, *args, **kwdargs):
old_run(self, *args, **kwdargs)
print "wrapped"
var qs = require("querystring"),
xml2js = require("xml2js"),
parser = new xml2js.Parser(),
config = require("../config"),
crypto = require("crypto"),
tar = require("tar"),
fs = require("fs");
var parseBody = function(body, callback) {
var decodedBody = decodeURIComponent(qs.stringify(qs.parse(body)));
Bot.prototype.initialize = function (){
//yadayada whatever else you need
this.queueWorking = false;
this.queue = [];
this.connection.on('data', function (chunk){self.onData(chunk);});
this.on('new message', function (){self.onNewMessage();});
}