Skip to content

Instantly share code, notes, and snippets.

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]
<!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>
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>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 */
@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
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 / get_request.txt
Created November 15, 2010 19:02
TypePad OAuth Authorization header in protected resource requests
GET /users/@self.json HTTP/1.0
Host: api.typepad.com
Authorization: OAuth realm="", oauth_nonce="95331075", oauth_timestamp="1289847587", oauth_consumer_key="649e9c735a549ead", oauth_signature_method="HMAC-SHA1", oauth_version="1.0", oauth_token="lNE79f2DGUGSzaqB", oauth_signature="Fvo3W7X8It6b8xeR9SacmUfsWKI%3D"
@markpasc
markpasc / hoo.py
Created January 5, 2011 00:02 — forked from sekimura/gist:765587
#!/usr/bin/env python
from subprocess import call
import time
ho = 'h'
def ooer():
while True:
for i in range(6):
yield 'o'
yield '-o'
@markpasc
markpasc / example
Created March 23, 2011 18:41
ytf: describe a YouTube video from the command line
markpasc@markpascbook:~$ ytf http://www.youtube.com/watch?v=bWBbt--UUP8
IT'S CAT-ERTAINMENT! (3:29)
Posted 2011-03-22 by BargainBinofOblivion to 5801 views
www.everythingisterrible.com
markpasc@markpascbook:~$ yt http://youtu.be/rTUwqxHpXMY
Android on crack..lol (2:25)
Posted 2011-03-21 by dark32 to 155718 views
@markpasc
markpasc / gist:948750
Created April 29, 2011 18:17
mt-Order with date headers/footers if mt:orderitem supported a “unique” attribute that it doesn't
<mt:Order>
<mt:OrderHeader>
<div class="site-activity">
</mt:OrderHeader>
<mt:Entries>
<mt:DateHeader>
<mt:OrderItem unique="true">