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
[["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"]] |
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 | |
"""Aliases for argparse positional arguments.""" | |
import argparse | |
class AliasedSubParsersAction(argparse._SubParsersAction): | |
class _AliasedPseudoAction(argparse.Action): | |
def __init__(self, name, aliases, help): |
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
int n = 2; | |
int count = 1; | |
while (count < 5) | |
{ | |
count *= n; | |
if (count / 2 < 2) | |
{ | |
System.out.println("Hello"); | |
} |
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
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++; |
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
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) |
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
public void mystery(int n) | |
{ | |
while ( n > 1) | |
{ | |
if (n % 2 == 0){ | |
n /= 2; | |
} | |
else { | |
n = 3 * n + 1; |
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
//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"); |
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
def my_decorator(klass): | |
old_run = klass.run | |
def wrapper(): | |
def new_run(self, *args, **kwdargs): | |
old_run(self, *args, **kwdargs) | |
print "wrapped" |
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 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))); |
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
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();}); | |
} |
NewerOlder