Skip to content

Instantly share code, notes, and snippets.

View AppController.h
#import <Cocoa/Cocoa.h>
@interface AppController : NSObject {
IBOutlet NSTextField *inputTextField;
IBOutlet NSTextField *outputTextField;
}
- (IBAction)countCharacters:(id)sender;
@end
View gist:14492
import feedparser
def get_tweets(query, page):
feeds = feedparser.parse("http://search.twitter.com/search.atom?q=" + str(query) + "&rpp&page=" + str(page) + "&show_user=true")
return feeds.entries
View gist:14495
import feedparser
import datetime
import time
def get_tweets(query, page):
feeds = feedparser.parse("http://search.twitter.com/search.atom?q=" + str(query) + "&rpp&page=" + str(page) + "&show_user=true")
return feeds.entries
def get_html_tweets(query, page):
View gist:14848
import re
from django import template
register = template.Library()
@register.filter
def twitter_user(message):
"""convert a "user:" to a link in twitter: <a href="htt://twitter.com/user>@user</a>"""
pattern = re.compile('[A-Za-z0-9]+:')
View gist:14854
igor@igorlaptop:~/dev/battletweets$ git pull
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 8 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (8/8), done.
From git@gitorious.org:battletwitts/mainline
4edec1b..e2cdde7 master -> origin/master
Removed media/img/twittniclog.png
Auto-merged templates/results.html
Merge made by recursive.
View gist:14985
diff --git a/battle/forms.py b/battle/forms.py
index 9516912..d31db35 100644
--- a/battle/forms.py
+++ b/battle/forms.py
@@ -1,4 +1,4 @@
-from django import newforms as forms
+from django import forms as forms
class MainForm(forms.Form):
option1 = forms.CharField( )
View gist:44751
# FacebookConnectMiddleware.py
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.conf import settings
import md5
import urllib
import time
import simplejson
from datetime import datetime
View gist:53101
diff --git a/templates/flatpages/default.html b/templates/flatpages/default.html
index 3a32a20..90ac531 100644
--- a/templates/flatpages/default.html
+++ b/templates/flatpages/default.html
@@ -1,10 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
- "http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>{{ flatpage.title }}</title>
View gist:53824
if has("gui_running")
colorscheme python
set guifont=Consolas\ bold\ 10
else
colorscheme elflord
endif
set cursorline
set mouse=a " enable mouse
set nocompatible " use vim defaults
View gist:53827
#!/bin/bash
if [ ! -f tags ];
then
ctags `find -iname '*.py'`
fi
export DJANGO_SETTINGS_MODULE=settings
gvim -geometry 128x38 $@