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
#!/Users/samuelkordik/.pyenv/shims/python | |
# ReadingListCatcher | |
# - A script for exporting Safari Reading List items to Markdown and Pinboard | |
# Originally by Brett Terpstra 2015, <https://brettterpstra.com/2015/01/06/reading-list-catcher/> | |
# Modifications by Zach Fine made in 2020 to use the original reading list item in the | |
# posts to pinboard. | |
# Updated 2021-06-21 by Samuel Kordik to fix errors due to deprecated API in plistlib, | |
# changes to Pinboard api and Pinboard python lib; added enhanced logging output | |
# and error handling to work as a cron job or shell script. | |
# Uses code from <https://gist.github.com/robmathers/5995026> |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
// javascript:(function()%20{window.frames.contentFrame.contentDocument.querySelector(%22%23solution%22).value%20=%20%22Duplicate%20EHR%20records%20have%20been%20removed.%20If%20the%20call%20has%20not%20been%20imported%20from%20CAD%2C%20it%20will%20remain%20in%20that%20import%20list%20for%20several%20days%20before%20automatically%20disappearing.%22;window.frames.contentFrame.contentDocument.querySelector(%22%23status%22).innerHTML%20=%20%27%3Coption%20value=%223%22%20selected=%22%22%3EClosed%3C/option%3E%27;window.frames.contentFrame.contentDocument.querySelector(%22%23status%22).onchange();var%20liElements%20=%20window.frames.contentFrame.contentDocument.querySelectorAll(%27%23td_34_status%20ul.newList%20li%27);for%20(var%20i%20=%200;%20i%20%3C%20liElements.length;%20i%2B%2B)%20{array[i].classList.remove(%27selected%27%2C%27hiLite%27);}window.frames.contentFrame.contentDocument.querySelector(%27%23td_34_status%20li.option_3_option%27).classList.add(%27selected%27%2C%20%27hiLite%27);window.frames.contentFrame |
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
javascript:(function(){ | |
// select active modal's quiz key view | |
var e = document.querySelectorAll('.modal.fade.in .quiz-key')[0]; | |
// set up object model to save to | |
var q = {}; | |
q.titl = e.querySelector('h3').innerHTML; | |
q.contents = []; | |
var qi_c = 0; | |
var imagesList = []; |
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 appC = Application.currentApplication(); | |
appC.includeStandardAdditions = true; | |
function fetchCurrentTask() { | |
var output = JSON.parse(appC.doShellScript("curl -v -u xxxx:api_token 'https://www.toggl.com/api/v8/time_entries/current'")); | |
if (output.data == null) { | |
return null; | |
} else { | |
return output.data; |
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
<?php | |
/** | |
* Functions for handling errors | |
*/ | |
/** | |
* Logs error message to the app-specific error log. | |
* | |
* @package App |
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 "System Preferences" | |
reveal pane "com.apple.preferences.Bluetooth" | |
end tell | |
tell application "System Events" to tell process "System Preferences" | |
click button 6 of window 1 | |
end tell | |
quit application "System Preferences" |
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
<?php | |
/** | |
* | |
* Simple Paystub Calculator | |
* Created by Samuel Kordik | |
* Copyright 2014 Samuel Kordik | |
* Licensed under MIT license -- feel free to use modify or extend as you wish, just attribute me in the source code. | |
* | |
* This single page form calculates paychecks based on a biweekly pay schedule using 2014 rates. | |
* It stores rate, # of deductions, pretax and posttax withdrawals in a cookie to simplify |
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
<?php | |
/** | |
* Handles backing up database automatically and emailing it to me. | |
*/ | |
date_default_timezone_set('America/Chicago'); // necessary in some server environments before using any Date/Time functions. | |
$timestart = microtime(true); | |
config(); // sets up constants and configurations for database credentials, error handling, etc. including using local environment specific options. | |
$filename = backup_tables(DB_HOST, DB_USER, DB_PASS, DB_NAME); // backs up data. |
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
<?php | |
public function getCSVData($file) { | |
$filename = __DIR__."/fixtures/$file.csv"; | |
if (!file_exists($filename)) throw new Exception("CSV file $filename doesn't exist."); | |
$csv = array_map("str_getcsv", file($filename, FILE_SKIP_EMPTY_LINES)); | |
$keys = array_shift($csv); | |
foreach ($csv as $i=>$row) { | |
$csv[$i] = array_combine($keys, $row); | |
} | |
return $csv; |
NewerOlder