Skip to content

Instantly share code, notes, and snippets.

View jpic's full-sized avatar
💾
Searching for my Monkey Island II floppy disks

Yacht Shaver jpic

💾
Searching for my Monkey Island II floppy disks
View GitHub Profile
@jpic
jpic / human_log.py
Last active March 25, 2016 17:55 — forked from cliffano/human_log.py
A version i use, posted here to comply with the license
# upstream: https://gist.github.com/cliffano/9868180
# Dunno if it still shares a single line with the original, but still i think the license forces me to post it. So here it is, my F****ING AWESOME CLASSY DEFAULT OUTPUTTER OVERRIDE !!
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@jpic
jpic / gist:4957328
Created February 14, 2013 23:25 — forked from jeanphix/gist:1406053
from ghost.ext.django.test import GhostTestCase
class SessionSecurityTestCase(GhostTestCase):
# Enable display (runs headless with False)
display = True
# Default port for LiveServerTestCase, from django docs:
# https://docs.djangoproject.com/en/1.4/topics/testing/#django.test.LiveServerTestCase
port = 8081
import sys
try:
f = open('myfile.txt')
s = f.readline()
i = int(s.strip())
except IOError as e:
print "I/O error({0}): {1}".format(e.errno, e.strerror)
except ValueError:
print "Could not convert data to an integer."