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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Threading; | |
namespace YourNamespaceHere | |
{ | |
[Serializable()] | |
public class RateLimiter |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
using System.Text; | |
namespace yourNameSpaceHere | |
{ | |
public static class StreamExtensions | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ExceptionsAreBad | |
{ | |
class Program | |
{ |
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
from pyItunes import * | |
import os | |
import sys | |
import urllib | |
extraFiles = [] | |
libraryLocation = None | |
if len(sys.argv) > 1: | |
libraryLocation = sys.argv[1] | |
else: |
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
#install postgres | |
brew install postgres | |
#setup postgres db dir | |
initdb -D /usr/local/var/postgres #init the database | |
#set postgres to load automatically && start postgres | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.1.2/org.postgresql.postgres.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist |
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
worker_processes 1; | |
#pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
upstream myapp { | |
server www.bing.com weight=2; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
using System.Text.RegularExpressions; | |
//TODO: probably want to change this if you're using it your project | |
namespace ClothesHorse.Core | |
{ |
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 class FSGrep | |
{ | |
public FSGrep() | |
{ | |
this.Recursive = true; | |
} | |
public String RootPath { get; set; } | |
public Boolean Recursive { get; set; } | |
public String FileSearchMask { get; 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
#naive implementation of a pi spigot algorithm | |
def gen_pi(n): | |
q, r, t, k, m, x = 1, 0, 1, 1, 3, 3 | |
for j in range(n): | |
if 4 * q + r - t < m * t: | |
yield m | |
q, r, t, k, m, x = 10*q, 10*(r-m*t), t, k, (10*(3*q+r))/t - 10*m, x | |
else: | |
q, r, t, k, m, x = q*k, (2*q+r)*x, t*x, k+1, (q*(7*k+2)+r*x)/(t*x), x+2 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
using dict = System.Collections.Generic.Dictionary<string, string>; | |
namespace <YOUR NAMESPACE HERE> | |
{ |
OlderNewer