This file contains 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
// ==UserScript== | |
// @name Blogger Content Warning Skip | |
// @description Automatically skips the content warning on blogspot.com sites without reloading the page | |
// @match http://*.blogspot.com/* | |
// ==/UserScript== | |
var fireEvent = function(obj,evt){ | |
var fireOnThis = obj; | |
if (document.createEvent) { | |
var evObj = document.createEvent('MouseEvents'); |
This file contains 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
"""Utilities for managing database sessions.""" | |
from __future__ import with_statement | |
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def temp_session(session_cls, **kwargs): | |
"""Quick and dirty context manager that provides a temporary Session object | |
to the nested block. The session is always closed at the end of the block. |
This file contains 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
#!/usr/bin/env python | |
import optparse | |
import sys | |
from boto.s3.connection import S3Connection | |
def sign(bucket, path, access_key, secret_key, https, expiry): | |
c = S3Connection(access_key, secret_key) | |
return c.generate_url( | |
expires_in=long(expiry), |
This file contains 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
"""Provides a `DateTimeRange` class, which is used for managing ranges of datetimes.""" | |
import datetime | |
class DateTimeRange(object): | |
"""Represents a range of datetimes, with a start and (optionally) an end. | |
Basically implements most of the methods on a standard sequence data type to provide | |
some lovely syntactic sugar. Specifically, you can iterate on this, index it, slice it, | |
use the in operator, reverse it, and use it in a boolean context to see if there is any | |
time in between the start and end.""" |
This file contains 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
// Package h2c provides a HTTP/2.0 h2c client transport implementation | |
package h2c | |
import ( | |
"bufio" | |
"bytes" | |
"context" | |
"encoding/base64" | |
"encoding/binary" | |
"fmt" |
This file contains 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
_getClipItems: () -> | |
unless @_clipItems? | |
@_clipItems = (c for c in @_children when c._clipMask) | |
return @_clipItems | |
draw: (ctx, param) -> | |
clipItems = @_getClipItems() | |
# If the group is to be clipped, draw them to an in-memory canvas |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<title>draft-ietf-oauth-v2-31 - The OAuth 2.0 Authorization Framework</title> | |
<!--[if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<link rel=stylesheet type="text/css" href="http://pretty-rfc.herokuapp.com/style.css"> | |
<meta name=viewport content="width=device-width, initial-scale=1.0"> | |
</head> |
This file contains 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 distutils.sysconfig as sysconfig | |
import re | |
import sublime | |
import sublime_plugin | |
FROM_IMPORT_RE = re.compile(r'^\s*from (?P<package>\.?\w*)(?P<package_extra>\S*)\s+import\s+(?P<subpackages>.+)') | |
PLAIN_IMPORT_RE = re.compile(r'^\s*import (?P<package>\.?\w*)(?P<package_extra>\S*)') | |
CONTINUATION_RE = re.compile(r'.*(\\\s*)$') | |
PARENTHESISED_START_RE = re.compile(r'^.+? import \(') |
This file contains 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
### Use the standard LV.Ticker event loop for jQuery animations, too (which uses requestAnimationFrame under the | |
covers, if supported by the client) ### | |
class LV.JQAnimation extends LV.Animation | |
constructor: (timer) -> | |
@timer = timer | |
@start() | |
return | |
step: () -> |
This file contains 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 distutils.sysconfig as sysconfig | |
import re | |
import sublime | |
import sublime_plugin | |
FROM_IMPORT_RE = re.compile(r'^\s*from (?P<package>\.?\w*)(?P<package_extra>\S*)\s+import\s+(?P<subpackages>.+)') | |
PLAIN_IMPORT_RE = re.compile(r'^\s*import (?P<package>\.?\w*)(?P<package_extra>\S*)') | |
CONTINUATION_RE = re.compile(r'.*(\\\s*)$') | |
PARENTHESISED_START_RE = re.compile(r'^.+? import \(') |
NewerOlder