Skip to content

Instantly share code, notes, and snippets.

@jsulak
jsulak / markdown_link_snippet.applescript
Created May 14, 2020 12:41
TextExpander snippet - create markdown link, with a special exception for Ulysses
@jsulak
jsulak / periodically_check_zoom_status.plist
Created May 3, 2020 15:32
Launchd plist for periodically checking zoom mute status
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/munki:/usr/local/sbin</string>
</dict>
<key>Label</key>
@jsulak
jsulak / zoom_audio.applescript
Last active January 26, 2021 22:03
Manipulate zoom mute/unmute status and update Anybar to reflect
-- Manipulate and get the status of Zoom mute/unmute, and show that status using the app AnyBar
-- Uses AnyBar to show zoom audio status (https://github.com/tonsky/AnyBar)
--
-- Takes one argument:
-- - toggle_zoom: Toggles the mute status and updates AnyBar red/green to reflect new status
-- - update_bar: Grabs the current mute status and updates AnyBar
--
-- Anybar colors:
-- - Green: mic on
-- - Red: mic muted
@jsulak
jsulak / zoom_audio_toggle_karabiner_modification.json
Last active April 30, 2020 17:42
Karabiner modification - eject key mapped to f13, command-f13 sequence
{
"title": "Zoom audio toggle modification",
"rules": [
{
"description": "Eject key triggers two keyboard shortcuts",
"manipulators": [
{
"from": {
"consumer_key_code": "eject"
},
@jsulak
jsulak / move_reminders_to_omnifocus.applescript
Last active April 11, 2022 09:37
Applescript to move tasks from Reminders.app to Omnifocus Inbox
-- Move everything in Reminders app to Omnifocus
tell application "Reminders"
repeat with theReminder in (get reminders in list "Reminders" whose completed is false)
with timeout of 120 seconds
set success to true
set the newName to (the name of theReminder) as string
set the dueDate to the due date of theReminder
@jsulak
jsulak / shift-arrow.el
Created July 1, 2012 00:54
Shift-arrow support in Emacs within GNU screen
;; Works in iTerm 2
(define-key global-map "\e[1;2A" (kbd "S-<up>"))
(define-key global-map "\e[1;2B" (kbd "S-<down>"))
(define-key global-map "\e[1;2D" (kbd "S-<left>"))
(define-key global-map "\e[1;2C" (kbd "S-<right>"))
@jsulak
jsulak / jquery-mobile-red-striped-buttons.css
Created June 28, 2012 19:34 — forked from justjohn/jquery-mobile-red-buttons.css
Red striped button CSS for JQuery Mobile
/* Red striped button theme for JQuery Mobile
* - Use data-theme="r" for red striped versions of the default JQuery Mobile Buttons.
******************************************************************************************/
.ui-btn-up-r {
border: 1px solid #721414;
background: #AB2525;
font-weight: bold;
color: #fff;
text-shadow: 0 -1px 1px #000;
}
@jsulak
jsulak / logtodayone.tcl
Created April 24, 2012 01:42
Log to Day One from the command line
#!/usr/bin/env tclsh
# logtodayone.tcl
# James Sulak (http://www.jamessulak.com)
# Adapted from logtodayone.rb by Brett Terpstra (http://brettterpstra.com)
# Use and modify freely, attribution appreciated
#
# This script works with the Day One[1] command line utility
# It parses an input string for an exclamation point prefix to mark starred
# and/or a [date string] at the beginning to parse natural language dates
@jsulak
jsulak / newterm
Created April 4, 2012 00:15
Create new OS X terminal window in current directory and bring to front
#!/bin/sh
osascript <<END
tell app "Terminal" to do script "cd \"`pwd`\""
tell app "Terminal" to activate
END
@jsulak
jsulak / test.js
Created March 27, 2012 20:27
FlightAware FlightXML 2.0 Node.js example
/*
* This requires: restler
* To install, type 'npm install restler'
* Tested with node.js v0.6.14
*/
var util = require('util');
var restclient = require('restler');
var fxml_url = 'http://flightxml.flightaware.com/json/FlightXML2/';