This file contains hidden or 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
def parse(string): | |
if not string: return | |
if string[0] != "(": raise ValueError("malformed string") | |
parsed = () | |
last = 0 | |
count = 0 | |
for i in range(len(string)): | |
if string[i] == "(": count += 1 | |
if string[i] == ")": count -= 1 | |
if count == 0: |
This file contains hidden or 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 Kicktraq links on Kickstarter project pages | |
// @version 1.2.1 | |
// @icon http://www.kicktraq.com/favicon.ico | |
// @match http://www.kickstarter.com/projects/*/* | |
// @match http://www.kickstarter.com/projects/*/*/ | |
// @match http://www.kickstarter.com/projects/*/*/* | |
// ==/UserScript== | |
h = ['http://www.kicktraq.com'].concat(window.location.href.split('/').slice(3,6)).join('/'); |
NewerOlder