Skip to content

Instantly share code, notes, and snippets.

View hortinstein's full-sized avatar

Alex Hortin hortinstein

View GitHub Profile
import re
f = open('equality.html','r')
char = f.read() # read by character
asd = re.findall('[^A-Z][A-Z][A-Z][A-Z][a-z][A-Z][A-Z][A-Z][^A-Z]', char)
print asd
import urllib
opener = urllib.FancyURLopener({})
SHITASSTITS = "46059"
f = opener.open("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" + SHITASSTITS)
s = f.read()
while s[0:3] == "and":
f = opener.open("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" + SHITASSTITS)
s = f.read()
SHITASSTITS = s[24:]
print SHITASSTITS
import zipfile
a = ""
zf = zipfile.ZipFile('channel.zip', 'r')
zipdict = {}
for info in zf.infolist():
print info.filename
zipdict[info.filename] = info.comment
f = open('channel/90052.txt','r').read()
while f[0:4] == "Next":
f = open('channel/' + f[16:] + '.txt','r').read()
file = open('Soduku.txt', 'r')
NumberOfGames = 50
GamesDatabase = {}
for i in range(NumberOfGames):
Game = file.readline()
Game = Game.strip()
for z in range(9):
line = file.readline()
line = line.strip()
@hortinstein
hortinstein / .railsTutorialscreenrc
Created July 5, 2011 12:18
screenrc for automating some rails setup (spork, autotest, server)
screen -t home
split -v
focus down
screen bash -c 'echo "rails server"; cd Documents/railsTutorial/sample_app/; rails s; exec bash -i;'
split
focus down
screen bash -c 'echo "spork"; cd Documents/railsTutorial/sample_app/; sleep 5; bin/spork; exec bash -i; '
split -v
focus down
screen bash -c 'echo "sql output"; cd Documents/railsTutorial/sample_app/; exec bash -i;'
@hortinstein
hortinstein / rails tutorial setup code
Created September 21, 2011 06:09
screen rc file for setting up
screen -t home
split -v
focus down
screen bash -c 'echo "rails server"; cd Documents/railsTutorial/sample_app/; rails s; exec bash -i;'
split
focus down
screen bash -c 'echo "spork"; cd Documents/railsTutorial/sample_app/; sleep 5; bin/spork; exec bash -i; '
split -v
focus down
screen bash -c 'echo "sql output"; cd Documents/railsTutorial/sample_app/; exec bash -i;'
var http = require('http');
var events = require('events');
var sys = require('util');
/// redditParser
// `
function RedditParser() {
if(false === (this instanceof RedditParser)) {
return new RedditParser();
}
events.EventEmitter.call(this)
//client
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');\
console.log('connets')
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
info: Creating snapshot 0.0.11-9
info: Updating app predditor
info: Activating snapshot 0.0.11-9 for predditor
info: Starting app predditor
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: socket hang up
error: at createHangUpError (http.js:1263:15)
error: at Socket.socketOnEnd (http.js:1351:23)
{
"name": "predditor",
"subdomain": "predditor",
"scripts": {
"start": "server.js"