Skip to content

Instantly share code, notes, and snippets.

@youzi
youzi / vim-term.applescript
Last active April 6, 2018 14:43
Open input file in active vim session or new vim session in iTerm
tell application "iTerm"
try
repeat with termWindow in windows
tell termWindow
repeat with termTab in tabs
tell termTab
repeat with termSession in sessions
tell termSession
if name contains " vim " then
write text ":e " & POSIX path of input
@youzi
youzi / pomodoro-calendar.applescript
Created March 9, 2018 08:49
Schedule tasks in "pomodoro" calendar in Calendar to get "focus" and "break" notifications.
on run {input, parameters}
tell application "Calendar"
tell calendar "Pomodoro"
repeat
try
set currentEvents to first event whose start date ≤ (current date) and end date > (current date)
set currentSummary to currentEvents's summary
display notification currentSummary with title "Focus on:" sound name "Frog"
delay 1500
display notification currentSummary with title "Take a break from:" sound name "Frog"
@youzi
youzi / notifications-to-dialogs.applescript
Last active March 12, 2018 10:05
Create dialogs for each Mac OS notification, making them "tabbable".
on run {input, parameters}
tell application "System Events"
tell process "NotificationCenter"
copy windows to notifications
repeat with notification in notifications
set btnNames to {}
set btnName to "OK"
set n to number of notification
repeat with btn in buttons of notification
@youzi
youzi / milestones.sh
Last active May 19, 2021 15:14
Create milestone and labels script
#!/bin/bash
echo -n "GitHub User: "
read USER
echo -n "GitHub Password: "
read -s PASS
echo ""
echo -n "GitHub Repo (e.g. foo/bar): "