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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
sudo apt-get install zlib1g-dev #ubuntu | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git | |
NO_EXPAT=yes NO_OPENSSL=yes NO_CURL=yes make -j4 prefix=~ | |
NO_EXPAT=yes NO_OPENSSL=yes NO_CURL=yes make -j4 prefix=~ install |
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
import SocketServer | |
class Handler(SocketServer.BaseRequestHandler): | |
def handle(self): | |
data = self.request[0].strip() | |
print self.client_address[0], data | |
server = SocketServer.UDPServer(("0.0.0.0", 5140), Handler) |
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
#!/bin/sh | |
sudo yum install -y gcc glibc-devel make ncurses-devel openssl-devel autoconf | |
curl -O https://raw.github.com/dreverri/kerl/master/kerl | |
chmod a+x kerl | |
KERL_CONFIGURE_OPTIONS="--enable-dynamic-ssl-libs" ./kerl build R13B04 r13b04 | |
./kerl install r13b04 |
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
import os | |
import signal | |
import time | |
def main(): | |
commands = [ | |
("python", "sample.py"), | |
("python", "sample.py"), | |
] |
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
#import <Cocoa/Cocoa.h> | |
@interface Delegate : NSObject { } | |
@end | |
@implementation Delegate | |
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) aBool | |
{ | |
[[NSApplication sharedApplication] terminate: nil]; | |
} |
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
import sys | |
rl = lambda: sys.stdin.readline().strip() | |
def perm(strl): | |
if len(strl) == 1: | |
return [strl] | |
perms = [] | |
for i in strl: | |
copied = strl[:] |
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
upstream streamer { | |
server 192.168.1.139:443; | |
} | |
# HTTPS server | |
# | |
server { | |
listen 443; | |
server_name woodstock; |
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 paren(n): | |
if n == 1: | |
return ['()'] | |
results = paren(n-1) | |
coms = set() | |
for i in results: | |
coms.add('()'+i) | |
coms.add('('+i+')') | |
coms.add(i+'()') | |
return coms |
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
import time | |
import signal | |
def main(): | |
d = {} | |
d["stop"] = False | |
def sighandler(signum, frame): | |
print signum, frame | |
d["stop"] = True |
OlderNewer