Skip to content

Instantly share code, notes, and snippets.

import json
import os
import httpretty
import pytest
from freeseer.plugins.importer.rss_feedparser import FeedParser
TEST_FEEDS = [
# (url, rss_file, json_file)
import requests
print 'Reading 0 bytes from a file'
fd = open(__file__)
print 'Closed:', fd.closed
print 'Read(0):', repr(fd.read(0))
print 'Closed:', fd.closed
print
Found one! "This woman is the worst", 5.0 MB - http://i.imgur.com/KnaUFmT.gif
Traceback (most recent call last):
File "/Users/mtomwing/Projects/gifprime2/gifprime/__main__.py", line 143, in wrapped_func
return func()
File "/Users/mtomwing/Projects/gifprime2/gifprime/__main__.py", line 161, in <lambda>
load_gif_f = lambda: run_reddit(args)
File "/Users/mtomwing/Projects/gifprime2/gifprime/__main__.py", line 120, in run_reddit
return decode(post.url, benchmark=args.time)
File "/Users/mtomwing/Projects/gifprime2/gifprime/__main__.py", line 128, in decode
return GIF.from_url(uri, force_deinterlace=force_deinterlace)
$.ready(function() {
function randint(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function katamari() {
$('body').append($('<script/>', {src: 'http://kathack.com/js/kh.js'}));
setTimeout(function () {
console.log('poop');
$('#loadingp button').click();
import itertools
import os
import sys
def is_valid_video(filepath):
return filepath.endswith('.gif')
def gather_files(path):
import abc
class Plugin(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def this_method_is_required(self, foo):
pass
(cmpt413)Michael-MBP[~/Projects/cmpt413/hw2][master *] python answer/view_distance.py "the multimedia prof is lame" "phil110 is a good course"
levenshtein distance = 33
t h e m u l _ _ _ t i m e d i a p r o _ f _ _ _ i s l a m e
| | | | | | | | |
p h _ _ _ i l 1 1 0 i _ _ s a _ g o o d c o u r s _ _ _ _ e
class MyForm(forms.Form):
name = forms.CharField(max_length=255)
rank = forms.ChoiceField(queryset=Rank.objects.all())
import abc
class Plugin(object):
'''This is the base class. It'll take care of all the lower level stuff.'''
__metaclass__ = abc.ABCMeta
class OutputPlugin(Plugin):
class MyClass(object):
FOO = 'bar'
def some_method(self):
pass
print dir(MyClass)
print hasattr(MyClass, 'FOO')