Skip to content

Instantly share code, notes, and snippets.

View EvanLovely's full-sized avatar

Evan Lovely EvanLovely

View GitHub Profile
@EvanLovely
EvanLovely / git-top-authors.sh
Created March 27, 2015 21:54
Show a list of the top authors of all the files in a folder, according to `git blame`.
#!/bin/bash
DIR="$1"
IFS=$'\n'
cd "$DIR"
LIST=""
for i in $(find . -iname "*.scss"); do
LIST="`git blame --line-porcelain "$i" | grep 'author ' | sed "s,author,," | tr -d ' '`
$LIST"
@EvanLovely
EvanLovely / Get_front_Mac_App_URL--markdown.applescript
Created May 27, 2014 22:05
Get Front Mac App Title and URL and make a Markdown Link to it
# Grab a URL from Chrome, Safari, Mail, Contacts, Finder, TextEdit, Omnifocus, Chrome Canary, or FoldingText
# Borrowed from: http://www.alfredforum.com/topic/917-reminders/?hl=reminders
tell application (path to frontmost application as text)
set theApplication to get name
end tell
set theText to ""
set theBody to ""
if theApplication is "Google Chrome" then
tell application id "com.google.chrome"
@EvanLovely
EvanLovely / applescript:_command-tab
Created July 31, 2013 00:03
Applescript: Command Tab
tell application "System Events"
key down command
keystroke tab
key up command
end tell
@EvanLovely
EvanLovely / get_title_and_url.applescript
Created March 28, 2017 00:26 — forked from vitorgalvao/Get Title and URL.applescript
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Google Chrome
tell application "Google Chrome" to return title of active tab of front window
tell application "Google Chrome" to return URL of active tab of front window
-- Google Chrome Canary
@EvanLovely
EvanLovely / applescript_command-tab
Last active October 29, 2021 23:17
Applescript: Command Tab
tell application "System Events"
key down command
keystroke tab
key up command
end tell
@EvanLovely
EvanLovely / Make new Reminder due in 3 days.applescript
Last active October 29, 2021 23:16
Create a new Apple Reminder due in 3 days with AppleScript
set _name to "name"
set _note to "note"
tell application "Reminders"
make new reminder with properties {name:_name, body:_note, due date:((current date) + 3 * days)}
end tell
@EvanLovely
EvanLovely / Make new Reminder.applescript
Created May 17, 2014 22:17
Create a new Apple Reminder with AppleScript
set _name to "name"
set _note to "note"
tell application "Reminders"
make new reminder with properties {name:_name, body:_note}
end tell
@EvanLovely
EvanLovely / highlight-code-bookmarklet.js
Last active September 1, 2021 13:49
Syntax highlighting bookmarklet
var colorScheme = 'darkula';
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type', 'text/css');
link.setAttribute('href', '//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/' + colorScheme + '.min.css');
document.getElementsByTagName('head')[0].appendChild(link);
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
@EvanLovely
EvanLovely / machine.js
Created November 18, 2020 22:47
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@EvanLovely
EvanLovely / machine.js
Last active August 24, 2020 20:20
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions