This file contains hidden or 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 json | |
import os | |
import httpretty | |
import pytest | |
from freeseer.plugins.importer.rss_feedparser import FeedParser | |
TEST_FEEDS = [ | |
# (url, rss_file, json_file) |
This file contains hidden or 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 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 | |
This file contains hidden or 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
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) |
This file contains hidden or 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
$.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(); |
This file contains hidden or 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 itertools | |
import os | |
import sys | |
def is_valid_video(filepath): | |
return filepath.endswith('.gif') | |
def gather_files(path): |
This file contains hidden or 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 abc | |
class Plugin(object): | |
__metaclass__ = abc.ABCMeta | |
@abc.abstractmethod | |
def this_method_is_required(self, foo): | |
pass |
This file contains hidden or 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
(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 |
This file contains hidden or 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
class MyForm(forms.Form): | |
name = forms.CharField(max_length=255) | |
rank = forms.ChoiceField(queryset=Rank.objects.all()) |
This file contains hidden or 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 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): |
This file contains hidden or 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
class MyClass(object): | |
FOO = 'bar' | |
def some_method(self): | |
pass | |
print dir(MyClass) | |
print hasattr(MyClass, 'FOO') |