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 re | |
import urllib | |
reg = '[\&|\?]q=(?P<terms>[^\?\&$]+)' | |
rx = re.compile(reg) | |
tests = [ | |
'http://www.evernote.com/about/kb/search?lang=en&q=test', | |
'http://www.evernote.com/about/kb/search?q=foo+bar&lang=en', |
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
$(function(){ | |
$("#apple").submit( | |
function(event){ | |
var price = $("#app_price").val(); | |
var units = $("#units").val(); | |
$("#gross").val(price * units); | |
$("#loss").val(((price * units) * 0.3) + 99); | |
$("#output").val(((price * units) * 0.7) - 99); | |
} | |
); |
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
var playerEmbedId = 'ytOverlayPlayer'; | |
var playerTargetId = 'videoOverlayTarget'; | |
var player = null; | |
var playerObj = null; | |
var QUERY_URL_BASE = 'http://www.youtube.com/v/'; | |
jQuery.fn.apicenter = function () { | |
this.css("position","fixed"); | |
this.css("top", ( $(window).scrollTop() + $(window).height() - this.height()-100 ) + "px"); |
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 random, sys | |
# define our list of candidate snippets | |
s = ["%snippet:typo1%","%snippet:typo2%","%snippet:typo3%"] | |
# select one at random and write it to STDOUT | |
sys.stdout.write(random.choice(s)) |
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
This a message about typos.\n\nAnd it has multiple lines! |
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
class ArticleFolderCollection(object): | |
"""A simple iterable collection for ArticleFolder objects""" | |
def __init__(self): | |
self.folders = [] | |
def __iter__(self): | |
for f in self.folders: | |
yield f | |
def __contains__(self, folder): |
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
class ArticleFolderCollection(object): | |
"""A simple iterable collection for ArticleFolder objects""" | |
def __init__(self): | |
self.folders = [] | |
def __iter__(self): | |
for f in self.folders: | |
yield f | |
def __contains__(self, folder): |
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
Help on package svn: | |
NAME | |
svn | |
FILE | |
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/svn/__init__.py | |
DESCRIPTION | |
# __init__.py: defines this directory as the 'svn' package |
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 os | |
import time | |
document = open("My Clippings.txt","r") | |
data = "".join(document.readlines()) | |
notes = [] | |
try: | |
clippings = data.split('==========') | |
for clip in clippings: |
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
tell application "Mail" | |
set selectedMsgs to selection | |
repeat with theMsg in selectedMsgs | |
set message_url to "message://%3c" & (the message id of theMsg) & "%3e" | |
tell application "Finder" | |
set the clipboard to message_url as text | |
end tell | |
exit repeat -- leave the repeat loop after one pass | |
end repeat | |
end tell |
OlderNewer