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
local function pressFn(mods, key) | |
if key == nil then | |
key = mods | |
mods = {} | |
end | |
return function() hs.eventtap.keyStroke(mods, key, 10) end | |
end | |
local function remap(mods, key, pressFn) |
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
<?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>Label</key> | |
<string>com.user.keyremap</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/hidutil</string> | |
<string>property</string> |
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
// https://bit.ly/3sZFmEN | |
let userInput = ` | |
SELECT "OrgUser"."id" AS "OrgUser_id", "OrgUser"."role" AS "OrgUser_role", "OrgUser"."user_id" AS "OrgUser_user_id", "OrgUser"."org_id" AS "OrgUser_org_id", "OrgUser"."created_at" AS "OrgUser_created_at", "OrgUser"."deleted_at" AS "OrgUser_deleted_at", "OrgUser"."updated_at" AS "OrgUser_updated_at" FROM "org_user" "OrgUser" WHERE "OrgUser"."user_id" = $1 AND "OrgUser"."deleted_at" IS NULL -- PARAMETERS: [7] | |
`; | |
let split = userInput.split('-- PARAMETERS: '); | |
var sql = split[0].trim(); | |
let params = JSON.parse(split[1]); |
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
/******************************************************************* | |
* Copy the following code into the FRONT SIDE of any card template in Anki. | |
* | |
* Find the next comment block for the snippet for the BACK SIDE. | |
******************************************************************/ | |
<script> | |
var modifyIt = document.getElementsByTagName("body")[0]; | |
if (document.getElementsByTagName("hr").length == 0) |
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
[alias] | |
co = checkout | |
br = branch | |
pl = pull | |
ph = push | |
A = add -A | |
amend = commit --amend | |
ammend = commit --amend | |
rebase = rebase --no-ff | |
uncommit = reset HEAD~1 |
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
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
autoload -Uz compinit && compinit | |
# https://superuser.com/a/1092328 | |
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' | |
## | |
## Git | |
## |
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
import re, fileinput | |
print 'SET FOREIGN_KEY_CHECKS=0;' | |
def main(): | |
for line in fileinput.input(): | |
process = False | |
for nope in ('BEGIN TRANSACTION','COMMIT', | |
'sqlite_sequence','CREATE UNIQUE INDEX'): | |
if nope in line: break |
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
## homebrew | |
export PATH="/usr/local/sbin:$PATH" | |
### aliases and functions | |
alias gits='git status' | |
alias gitbr='git branch ' | |
alias reload='source ~/.bash_profile' | |
alias b_p='vim ~/.bash_profile' | |
alias grep='grep --color' | |
alias ls='ls -1' # each file/folder on it's own line |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
from subprocess import call | |
if len(sys.argv) == 1: | |
print("Usage:\n ios-resize filename @3x_size_optional_param (32x32)") | |
sys.exit() |
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
import urllib.request | |
import datetime | |
file_name = datetime.datetime.now().strftime("%Y-%m-%d %H.%M") + ".jpg" | |
urllib.request.urlretrieve("https://www.stevenspass.com/cams/cowboy/", "./cowboy/" + file_name) | |
urllib.request.urlretrieve("https://www.stevenspass.com/cams/base1/", "./base1/" + file_name) | |
urllib.request.urlretrieve("https://www.stevenspass.com/cams/jupiter/", "./jupiter/" + file_name) |
NewerOlder