Skip to content

Instantly share code, notes, and snippets.

View jutoart's full-sized avatar

Art Huang jutoart

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jutoart on github.
  • I am jutoart (https://keybase.io/jutoart) on keybase.
  • I have a public key ASB0dFiNfa9WzeCjkgcBtS0Eswz95xTd5pcdKuD5E2SRGQo

To claim this, I am signing this object:

@jutoart
jutoart / git_commands.sh
Created October 15, 2019 06:35
Git commands
# Add upstream and set upstream
git remote add upstream git@github.com:xxx/xxx.git
git fetch upstream
git branch -u upstream/master
@jutoart
jutoart / taiwanDateFormatter.swift
Last active October 1, 2019 10:21
Get Date object from Taiwan date string
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyMMdd"
dateFormatter.locale = Locale(identifier: "zh_Hant_TW")
dateFormatter.timeZone = TimeZone(identifier: "Asia/Taipei")
dateFormatter.calendar = Calendar(identifier: .republicOfChina)
@jutoart
jutoart / erase_all_simulators.sh
Created August 15, 2019 09:42
Erase all simulators
xcrun simctl erase all
@jutoart
jutoart / delete_xcode_runtimes.sh
Created July 17, 2019 02:51
Helping Xcode “forget” about runtimes and prevent from re-installing them - delete .dmg file(s) here
rm ~/Library/Caches/com.apple.dt.Xcode/Downloads/*
@jutoart
jutoart / delete_unavailable_simulators.sh
Created July 17, 2019 02:50
Delete simulators that are unavailable to current Xcod
xcrun simctl delete unavailable
@jutoart
jutoart / remove_simulator_old_logs.sh
Last active July 17, 2019 02:49
Remove old logs of simulator
find ~/Library/Logs/CoreSimulator/ -depth 1 -type d -mtime +12w -exec rm -rf {} \;
#!/bin/bash
# This script checks the binary and all nested frameworks for duplicated classes (both ObjectiveC and Swift).
# The script fails if it finds any duplicated classes.
function print_classes() {
otool -ov "$1" |
sed -n '/Contents of (__DATA,__objc_classlist)/,/Contents of/p' | # all lines for (__DATA,__objc_classlist) section
egrep '^[0-9]' | # take just a class header
cut -d ' ' -f 3 | # take just a symbol name
@jutoart
jutoart / clean_simulator_logs.txt
Created February 11, 2019 03:45
Clean mysterious simulator logs
find ~/Library/Developer/Xcode/UserData/IB\ Support/Simulator\ Devices/*/data/tmp -iname "*.uicatalog" -type f -atime +1 -delete