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 BetteridgeLinks | |
// @description Lowlight headlines on Hacker News that conform to Betteridge's Law | |
// @version 0.3 | |
// @match http://news.ycombinator.com/* | |
// @match https://news.ycombinator.com/* | |
// @author noibl <pjpee6w5pc@snkmail.com> | |
// ==/UserScript== | |
var questions = ['Is', 'Are', 'Does', 'Do', 'Has', 'Have', 'Did', 'Will', 'Can', 'Could', 'Should']; |
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
/* jshint maxerr : 10000 */ | |
/* jslint browser : true */ | |
/* jslint esversion : 6 */ | |
try { | |
console.log('foo') | |
console.log('foo') | |
console.log('foo') | |
console.log('foo') | |
console.log('foo') |
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 Song | |
# Regular expressions | |
RE = { | |
:featured => /(featuring | ?ft\.? |feat\.? |f\. |w\/){1}/i, | |
:remixer => / remix| rmx| edit| bootleg| mix| remake| re-work| rework| extended remix| bootleg remix/i, | |
:mashup_split => / \+ | x | vs\.? /i, | |
:producer => /^(produced by|prod\.? by |prod\. )/i, | |
:cover => / cover/i, | |
:split => /([^,&]+)(& ?([^,&]+)|, ?([^,&]+))*/i, # Splits "one, two & three" | |
:open => /[\(\[\{]/, |
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 objc | |
import AddressBook as ab | |
import pprint as pp | |
def pythonize(objc_obj): | |
if isinstance(objc_obj, objc.pyobjc_unicode): | |
return unicode(objc_obj) | |
elif isinstance(objc_obj, ab.NSDate): | |
return objc_obj.description() |
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 python script listens for distributed notifications from iTunes of new songs playing, | |
works alot better then constantly polling. | |
''' | |
import Foundation | |
from AppKit import * | |
from PyObjCTools import AppHelper | |
class GetSongs(NSObject): | |
def getMySongs_(self, song): |
NewerOlder