Skip to content

Instantly share code, notes, and snippets.

javascript:s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/674826/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')
@markpasc
markpasc / gist:665052
Created November 6, 2010 00:02
less interactive authorization
from oauth.oauth import OAuthConsumer, OAuthToken
import typepad
consumer = OAuthConsumer('your consumer token', 'your consumer secret')
app = typepad.Application.get_by_id('your Application ID')
oauth_client = typepad.OAuthClient(consumer, None)
oauth_client.request_token_url = app.oauth_request_token_url
oauth_client.access_token_url = app.oauth_access_token_url
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Background border-radius fringing example</title>
<style type="text/css">
/* 960.gs reset.css */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
/* 960.gs text.css */
import urlparse
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from oauth.oauth import OAuthToken, OAuthConsumer
import typepad
class MainHandler(webapp.RequestHandler):
def get(self):
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>lastface</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<style type="text/css">
img { background: url(http://static.typepad.com/.shared/images/spinner.gif) no-repeat center center;
</style>
class EndTagSet(object):
def __init__(self, *tags):
self.tags = set(tags)
def __contains__(self, token_contents):
# Grab out the command so we can match on the tag name, not the
# whole tag contents.
try:
command = token_contents.split()[0]
#!/usr/bin/perl
# Show battery status from LaunchBar.
# Drop this in your App Support/LaunchBar/Actions dir, chmod it +x, and have
# LaunchBar reindex to find it.
package Battery;
use Encode;
use charnames ':full';
@import url(http://lab.arc90.com/experiments/readability/css/readability.css);
/* Make long lines in <pre> tags wrap anyway. */
pre {
white-space: pre-wrap;
}
#!/usr/bin/env python
"""Searches for your friends on Hype Machine (hypem.com) by seeing if there are
Hype Machine users who have the same usernames as people you follow on TypePad
or Twitter."""
import logging
import sys
from time import sleep
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> cdnize = re.compile(r'http://www.example.com/(images.*)')
>>> text = ("""<p><a href="http://www.example.com/images/full_size_image.jpg">"""
... """<img src="http://www.example.com/images/assets_c/thumbnail.jpg">"""
... """</a></p>""")
>>> print text
<p><a href="http://www.example.com/images/full_size_image.jpg"><img src="http://www.example.com/images/assets_c/thumbnail.jpg"></a></p>