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): |
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
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
/* 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
// ==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
#Download Elementary OS from here: | |
#http://sourceforge.net/projects/elementaryos/files/stable/ | |
#First you update your system | |
sudo apt-get update && sudo apt-get dist-upgrade | |
#Install Google Chrome | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' |
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
#!/bin/bash | |
#no PATH, no way to accidently run any programs | |
PATH='' | |
#useful variables | |
term_height=0 | |
term_width=0 | |
term_scroll_height=0 | |
status_line_row=0 |
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
#!/bin/bash | |
# This is a draft but it works | |
# FIRST (I don't even know if it works but we'll assume yes) | |
# sudo launchctl list | |
# sudo launchctl disable system/netbiosd | |
# sudo launchctl disable system/parsecd | |
# sudo launchctl disable system/parentalcontrols.check | |
# sudo launchctl disable system/airportd |
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
#define _XOPEN_SOURCE 700 | |
#include <signal.h> | |
#include <unistd.h> | |
int main() | |
{ | |
sigset_t set; | |
int status; | |
if (getpid() != 1) return 1; |
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
-- AppleScript -- | |
-- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
-- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
-- This method is as good as its JXA counterpart. | |
-- Google Chrome | |
tell application "Google Chrome" to return title of active tab of front window | |
tell application "Google Chrome" to return URL of active tab of front window | |
-- Google Chrome Canary |
OlderNewer