Skip to content

Instantly share code, notes, and snippets.

View ejisoo's full-sized avatar
🥽

Jisoo ejisoo

🥽
  • 22:52 (UTC -06:00)
View GitHub Profile
# Bindings {{{
# Remap prefix
# unbind C-b
# set -g prefix C-a
# set-option -g default-command "reattach-to-user-namespace -l /usr/local/bin/bash"
# set -g mode-mouse on
# Quick key for moving back to the previous window
bind-key L last-window
# cd to the current Path Finder directory
# https://github.com/niksy/dotfiles/blob/master/.functions
function cdf() {
target=$(osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)')
cd "$target"
}
# function cdf() {
# cd "$(osascript -e 'tell application "Path Finder" to POSIX path of the target of the front finder window')"
# }
# Self
alias bashrc='$EDITOR ~/.bashrc && source ~/.bashrc'
alias aliases='$EDITOR ~/.aliases && source ~/.aliases'
alias functions='$EDITOR ~/.functions && source ~/.functions'
alias vim="nvim"
alias nvimrc='nvim ~/.config/nvim/init.vim'
# Unix
alias c="clear"
||ci4.googleusercontent.com/proxy^/[a-zA-Z0-9_=-]+#https?/
||ci6.googleusercontent.com/proxy^/[a-zA-Z0-9_=-]+#https?/
||ci5.googleusercontent.com/proxy^/[a-zA-Z0-9_=-]+#https?/
@ejisoo
ejisoo / make_writable.sh
Created January 13, 2018 02:48
Make read-only disk writable
#!/bin/bash
diskutil umount disk2s2 \
&& sudo mkdir /Volumes/mydrive \
&& sudo mount -t hfs -o nosuid,-w /dev/disk2s2 /Volumes/mydrive
# sudo mount -t hfs -o nosuid,-w,-m=755
@ejisoo
ejisoo / music.sh
Created January 13, 2018 02:42
Useful commands for music metadata
#!/bin/bash
# rename 's/ - [a-zA-Z.]+\.flac/\.flac/' *.flac
for file in *.flac; do
# metaflac --show-tag=TITLE "${file}"
metaflac --remove-tag=COMMENT "${file}"
done
for file in *.flac; do
@ejisoo
ejisoo / dump_tabs.applescript
Last active May 3, 2017 03:14
Dump URLs of Safari tabs to TextEdit
tell application "Safari Technology Preview"
set allWindows to every window
set resultText to ""
repeat with currentWindow in allWindows
set tabcount to number of tabs in currentWindow
-- log tabcount
repeat with x from 1 to tabcount
set tabName to name of tab x of currentWindow
set tabURL to URL of tab x of currentWindow
-- Markdown link format
@ejisoo
ejisoo / fix_timestamp.py
Created May 2, 2017 06:18
Fix mutt inbox timestamps (old code)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import datetime
import itertools
import os
import subprocess
import time
import re
@ejisoo
ejisoo / cleanup_psd.sh
Created March 6, 2017 23:31
Find and move .psd files
#!/bin/sh
tmpdir=`mktemp -d psd_XXX`
old_ifs="$IFS"; IFS=$'\n'
for file in $(find . -type f -name "*.psd" 2>/dev/null); do
# du -sh "$file"
echo "$file"
mv "$file" "$tmpdir"
done
IFS="$old_ifs"; unset old_ifs
#!/bin/bash
delta=10
output=$(echo "$1" | sed s/.pdf/_scaled.pdf/)
width="612" # width of Letter in points
height="792" # height of Letter in points
shift=$(echo "scale=4; ${delta} / 2" | bc)
dwidth=$(echo "scale=4; ${width}"'*'"( ${shift} / 100 )" | bc)