Skip to content

Instantly share code, notes, and snippets.

View chrisfsmith's full-sized avatar

Chris Smith chrisfsmith

  • SmartThings
  • Saint Paul, MN
View GitHub Profile
@chrisfsmith
chrisfsmith / swarm.js
Created March 29, 2023 18:59
Boop script to remove leading/trailing quotes, unescapes, and json formats your text
/**
{
"api":1,
"name":"Swarm",
"description":"Removes leading/trailing quotes, unescapes, and json formats your text",
"author":"Chris",
"icon":"broom",
"tags":"remove,slashes,escape,json,prettify,clean,indent"
}
**/
@chrisfsmith
chrisfsmith / karabiner.json
Created June 27, 2017 02:05
Karabiner Elements config for CAPS ==> HYPER
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
@chrisfsmith
chrisfsmith / SleepDisplay.scpt
Created January 19, 2017 14:26
AppleScript to sleep the display immediately
do shell script "pmset displaysleepnow"
@chrisfsmith
chrisfsmith / FantasticalCalendarView.scpt
Last active August 29, 2015 14:18
AppleScript to open the Fantastical 2 full calendar view.
delay 0.1 -- time to release modifier keys for shortcut
tell application "System Events"
tell application "Fantastical 2" to activate
delay 0.1
keystroke "0" using command down
end tell
[merge]
tool = intellij
[mergetool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\\ 14.app/Contents/MacOS/idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[diff]
tool = intellij
[difftool "intellij"]
cmd = /Applications/IntelliJ\\ IDEA\\ 14.app/Contents/MacOS/idea diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
@chrisfsmith
chrisfsmith / theme.zsh
Last active August 29, 2015 14:01
Tab title shows git repo name
function tab_title() {
local REPO=$(basename `git rev-parse --show-toplevel 2> /dev/null` 2> /dev/null) || return
if [[ -z $REPO ]]
then
echo "%20<…<${PWD/#$HOME/~}%>>" # 20 char left truncated PWD
else
echo "%20>…>$REPO%>>🔹" # 20 char right truncated
fi
}
@chrisfsmith
chrisfsmith / keybase.md
Created April 15, 2014 03:36
Keybase Proof

Keybase proof

I hereby claim:

  • I am chrisfsmith on github.
  • I am chrissmith (https://keybase.io/chrissmith) on keybase.
  • I have a public key whose fingerprint is 4B64 64AC B025 EC63 2F6C AE85 1D1E F978 453E DB83

To claim this, I am signing this object:

@chrisfsmith
chrisfsmith / JIRA Search.applescript
Created September 9, 2013 19:34
Automator service applescript that opens a JIRA issue in chrome. Use it from Launchbar.
on run {input, parameters}
set sedCommand to "echo \"" & input & "\" | sed \"s/^[ ]*//;s/[ ]*$//;s/[ ]\\{1,\\}/-/g;s/-\\{1,\\}/-/\"" as string
set sedResult to do shell script sedCommand
set currentURL to "https://bloomhealthco.atlassian.net/browse/" & sedResult
if currentURL is not "" then
tell application "Google Chrome"
activate
@chrisfsmith
chrisfsmith / gist:3896705
Created October 16, 2012 01:04
Close hg Branch Snippet for CodeBox
hg up -C __branchName__ && \
hg commit --close-branch -m 'Closing branch __branchName__'