This file contains hidden or 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/osascript | |
on run argv | |
set project to (do shell script "pwd") | |
tell application "iTerm2" | |
tell current window | |
tell current session | |
write text "clear; cd " & project |
This file contains hidden or 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
function terndiff() { | |
temp_db_name="tern_dev_$(date +%s)" | |
dropdb $temp_db_name 2>/dev/null | |
createdb $temp_db_name | |
PGDATABASE=$temp_db_name tern migrate >/dev/null | |
expected_structure=$(PGDATABASE=$temp_db_name pg_dump -s) | |
dropdb $temp_db_name | |
current_structure=$(pg_dump -s) |
This file contains hidden or 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 ruby | |
file = ARGV[0] | |
line_num = ARGV[1].to_i | |
TestFn = Struct.new(:name, :start_line, :end_line) | |
tests = [] | |
current_test = nil | |
File.read(file).lines.each.with_index do |line, i| | |
if line.start_with?("func Test") |
This file contains hidden or 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
{ | |
"key": "\\ t", | |
"command": "terminalCommandKeys.run", | |
"when": "editorTextFocus && vim.mode != 'Insert'", | |
"args": { | |
"cmd": "\u0015rails test ${file}", | |
"newTerminal": false, | |
"saveAllFiles": true, | |
"showTerminal": true, | |
"focus": true |
This file contains hidden or 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
function ,lipqr() { | |
ruby << RUBY | |
require "rqrcode" | |
class String | |
def colorize(color_code) | |
"\e[#{color_code}m#{self}\e[0m" | |
end | |
def bg_black |
This file contains hidden or 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
# Custom Domain: dmp.dillonhafer.com | |
# DMP's LAN ip: 172.16.0.1 | |
server { | |
listen 443 ssl; | |
listen [::]:443 ssl; | |
server_name dmp.dillonhafer.com; | |
ssl_session_cache shared:SSL:20m; | |
ssl_session_timeout 10m; |
This file contains hidden or 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
update users | |
set email = replace( | |
email, | |
substring( | |
email, | |
locate('@', email), | |
length(email) - locate(email, '@') | |
), | |
'@example.com' | |
); |
This file contains hidden or 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
🍄: bin/rails server | |
💨: bin/rails tailwindcss:watch | |
🔥: firebase emulators:start --project firebase-project-id --import=./emulator-data | |
☕️: yarn build --watch |
This file contains hidden or 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
sox -q -d -t .wav f.wav silence 1 0.1 4% 1 0.01 5% | |
./right-click | |
sleep 1 | |
./right-click |
This file contains hidden or 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
#!/bin/bash | |
# Keep last 5 files ending in .dump | |
# Don't forget to | |
# Installation | |
# 1. cp pg-backups.sh /usr/local/bin/ | |
# 2. chmod u+x /usr/local/bin/pg-backups.sh | |
# 3. Set the DB variable | |
# 4. Set the BACKUP_DIR variable |
NewerOlder