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 "iTunes" to activate | |
tell application "System Events" | |
tell window "iTunes" of process "iTunes" | |
click (first UI element whose help is "Choose which speakers to use.") | |
end tell | |
end tell |
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
-- original from http://hea-www.harvard.edu/~fine/OSX/safari-tabs.html | |
-- Last updated January 16, 2015 1:22 PM | |
set searchpat to "fastmail.com" | |
tell application "Safari" | |
activate | |
set winlist to every window | |
set winmatchlist to {} | |
set tabmatchlist to {} | |
set tabnamematchlist to {} | |
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
/* | |
Copyright 2017 Max Masnick | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT |
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 url = 'http://something.youruniversity.edu/foo/bar'; | |
var doi; | |
var suffixes = { | |
"pmid": "?sid=Entrez:PubMed&id=pmid:", | |
"doi": "?sid=Entrez:DOI&id=doi:" | |
}; | |
var re = /^[0-9]{5,15}/; | |
var found = jQuery(jQuery(".rprtid dd")[0]).text().match(re); |
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 pandas as pd | |
from sqlalchemy import create_engine | |
engine = create_engine('mysql://{}:{}@{}/{}'.format(username, password, server, database_name)) | |
connection = engine.connect().connection | |
cursor = connection.cursor() | |
cursor.execute('call storedProcName(%s, %s, ...)', params) | |
# Result set 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
* NOTE: this ADO uses shell calls to run `rm`, so it could potentally delete files | |
* from your computer. Use at your own risk. | |
cap drop program loadsql | |
program define loadsql | |
*! Load the output of an SQL file into Stata, version 1.3 (dvmaster@gmail.com) | |
*! Based on http://stackoverflow.com/a/12272627/173351 | |
version 14.1 | |
syntax using/, DSN(string) [User(string) Password(string) CLEAR NOQuote LOWercase SQLshow ALLSTRing DATESTRing] |
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
{ | |
name = "Correspondence Arc"; | |
rootViewer = | |
{ | |
viewerType = "MmSplitView"; | |
orientation = "horizontal"; | |
children = | |
( | |
{ | |
viewerType = "MmBoxView"; |
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 re = /^[0-9]{5,15}/; | |
var found = jQuery(jQuery('.rprtid dd')[0]).text().match(re); | |
if(found != null) { | |
location.href = "http://sfx.umd.edu/hs?sid=Entrez:PubMed&id=pmid:"+found[0]; | |
} | |
else { | |
alert('PubMedID not found.'); | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// https://github.com/FokkeZB/J2M/blob/master/script.js | |
function toJ(converted) { | |
converted = converted.replace(/^(.*?)\n([=-])+$/gm, function (match,content,level) { | |
return 'h' + (level[0] === '=' ? 1 : 2) + '. ' + content; | |
}); | |
converted = converted.replace(/^([#]+)(.*?)$/gm, function (match,level,content) { | |
return 'h' + level.length + '.' + content; | |
}); |