Skip to content

Instantly share code, notes, and snippets.

View sVim.rc
set nosmoothscroll
let scrollstep = 100
let homeurl = "about://"
let newtaburl = "about://"
let blacklists = ["https://mail.google.com/*","https://www.youtube.com/*","https://github.com/notifications*"]
View xcode-to-tig-blame.applescript
tell application "Xcode"
set CurrentDocument to document 1 whose name ends with (get name of front window)
set FilePath to path of CurrentDocument
set {start, _} to selected paragraph range of CurrentDocument
tell application "Terminal"
do script "FILE=\"" & FilePath & "\"; cd \"$(dirname \"$FILE\")\"; cd \"$(git rev-parse --show-toplevel)\"; tig blame +" & start & " \"$FILE\""
activate
end tell
View sVim.css
.sVim-hint {
background-color: #FFC542;
color: #000;
font-size: 12px;
font-family: Helvetica;
font-weight: bold;
padding: 1px 3px 0px;
border-radius: 3px;
opacity: 1;
}
View xcode-fullscreen-simulator.sh
#!/bin/bash
# Enables full/split-screen window modes in the running Simulator.app instance
# (original idea: https://twitter.com/stroughtonsmith/status/799664540996739073)
#
# Works by attaching with LLDB to the running Simulator.app instance and
# adding -Primary, -Auxiliary and -AllowsTiling collectionBehavior's to existing windows.
# Note that this is usually impossible due to SIP (System Integrity Protection). One
# workaround is to remove code signature from the Simulator binary.
#
@odnoletkov
odnoletkov / lastsim.sh
Created Jul 31, 2015
Lookup sandbox directory of the most recently launched application in iOS Simulator
View lastsim.sh
#!/bin/sh
device_file=$(find ~/Library/Developer/CoreSimulator/Devices/*/data/var/run/launchd_bootstrap.plist -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
device=${device_file%/*/*/*}
#echo $device
app_caches=$(find ${device}/Containers/Data/Application/*/Library/Caches -d 0 -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -n 1 | cut -d " " -f 2-)
#echo $app_caches
app=${app_caches%/*/*}