Skip to content

Instantly share code, notes, and snippets.

View tcpthecode's full-sized avatar

Tu Cao tcpthecode

  • HCMC
View GitHub Profile
@tcpthecode
tcpthecode / lldb-debugging.md
Created December 8, 2020 07:07 — forked from alanzeino/lldb-debugging.md
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.

# Bash best practices and style-guide
Just simple methods to keep the code clean.
Inspired by [progrium/bashstyle](https://github.com/progrium/bashstyle) and [Kfir Lavi post](http://www.kfirlavi.com/blog/2012/11/14/defensive-bash-programming/).
## Quick big rules
* All code goes in a function
* Always double quote variables
@tcpthecode
tcpthecode / xc_open_smerge
Created October 20, 2020 10:26
Quick open Sublime Merge by Xcode's Behaviors script
#!/bin/bash
BIN_PATH="/Applications/Sublime Merge.app/Contents/SharedSupport/bin"
BIN_NAME=smerge
LINK_PATH=/usr/local/bin
if [[ ! -f $LINK_PATH/$BIN_NAME ]];then
ln -s "${BIN_PATH}/$BIN_NAME" $LINK_PATH/$BIN_NAME
fi
@tcpthecode
tcpthecode / x.rb
Last active October 14, 2020 06:57
Open Xcode Project
#!/usr/bin/env ruby
def _open(xcode, name)
system("open -a #{xcode} #{name} &> /dev/null")
if $?.success?
exit 0
end
end
project = ARGV[0]
@tcpthecode
tcpthecode / xsdk.sh
Last active September 28, 2020 04:13
Switch Xcode Version
#!/bin/bash
if [[ -z "$1" ]];then
echo "Enter xcode version (listing in /Applications , 11.5 | 11.7 | 12)"
exit 1
fi
sudo xcode-select -s /Applications/Xcode$1.app
xcode-select -p
@tcpthecode
tcpthecode / checkLoadCommand.rb
Created September 25, 2020 08:18
Check a lib (static or dynamic) is build for iOS simulator (x86_64) or OSX (x86_64)
#!/usr/bin/env ruby
libPath=ARGV[0]
if libPath.nil?
puts "❌ Enter lib path"
exit 1
end
result=`otool -l #{libPath}`
@tcpthecode
tcpthecode / exportOptionsAdHoc.plist
Created September 24, 2020 09:12 — forked from cocoaNib/exportOptionsAdHoc.plist
Xcode build with exportOptionsPlist
<?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>method</key>
<string>ad-hoc</string>
</dict>
</plist>