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 getMeta(metaName) { | |
const metas = document.getElementsByTagName('meta'); | |
for (let i = 0; i < metas.length; i++) { | |
if (metas[i].getAttribute('property') === metaName) { | |
return metas[i].getAttribute('content'); | |
} | |
} | |
return ''; |
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
Safari = Application('Safari'); | |
Safari.includeStandardAdditions = true; | |
SystemEvents = Application('System Events') | |
SystemEvents.includeStandardAdditions = true; | |
activeAppName = SystemEvents.processes.whose({frontmost:true}).at(0).name(); | |
activeApp = Application(activeAppName); | |
function run(){ | |
frontWindow = Safari.windows.at(0); | |
SystemEvents.activate() |
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
sqlite3 -header -csv "$HOME/Library/Application Support/Alfred 3/Databases/clipboard.alfdb" "select item, app from clipboard;" > ~/Desktop/out.csv |
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 ga_code_search() { | |
# alias todo='ga_code_search "TODO\(`whoami`\)"' | |
SCREEN_WIDTH=`stty size | awk '{print $2}'` | |
SCREEN_WIDTH=$((SCREEN_WIDTH-4)) | |
# Given a spooky name so you can alias to whatever you want. | |
# (cs for codesearch) | |
# AG is WAY faster but requires a binary | |
# (try brew install the_silver_searcher) |
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 ga_code_search() { | |
# alias todo='ga_code_search "TODO\(`whoami`\)"' | |
SCREEN_WIDTH=`stty size | awk '{print $2}'` | |
SCREEN_WIDTH=$((SCREEN_WIDTH-4)) | |
# Given a spooky name so you can alias to whatever you want. | |
# (cs for codesearch) | |
# AG is WAY faster but requires a binary | |
# (try brew install the_silver_searcher) |
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
/* | |
References: | |
http://www.macdevcenter.com/pub/a/mac/2002/08/27/cocoa.html?page=2 | |
https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/AddressBook/Tasks/AccessingData.html#//apple_ref/doc/uid/20001023-BABHHIHC | |
*/ |
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
""" | |
You can download the flickr API by running | |
pip install flickrapi | |
Info here: | |
http://stuvel.eu/media/flickrapi-docs/documentation/2-calling.html | |
You'll need to create a Flickr API app here: |
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 httplib | |
import urllib | |
def pushover(title, message): | |
conn = httplib.HTTPSConnection("api.pushover.net:443") | |
conn.request( | |
"POST", "/1/messages.json", | |
urllib.urlencode({ | |
"token": "", |
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
app = Application("PdfPenPro") | |
app.includeStandardAdditions = true; | |
templatePath = Path("/Users/username/Rent Receipt Template.pdf") | |
savePath = Path("/Users/rjames/apartment") | |
var getByName = function(fileName){ | |
return app.documents.byName(fileName); | |
} |
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
from xml.etree.ElementTree import Element, SubElement, tostring | |
from os import path | |
from Foundation import ( | |
CFPreferencesAppSynchronize, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyKeyList, | |
CFPreferencesSetValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesCurrentHost |
NewerOlder