Skip to content

Instantly share code, notes, and snippets.

View billypchan's full-sized avatar
😶
Focusing

Bill Chan billypchan

😶
Focusing
View GitHub Profile
git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done
sudo gem install -n /usr/local/bin cocoapods -v 1.3.1
(lldb) expr -l Swift -- import UIKit
(lldb) expr -l Swift -- let $view = unsafeBitCast(0x7fbe2ac66ee0, to: UIView.self)
(lldb) expr -l Swift -- print($view.superview)
print("🤛 leftView.hidden = YES, layer.presentation()?.frame =\(String(describing: (self.leftView.layer.presentation()?.frame)!))")
extension UIApplicationState : CustomStringConvertible {
public var description: String {
switch self {
case .active: return "active"
case .inactive: return "inactive"
case .background: return "background"
}
}
## for imported photos of iPhone, after this step, screenshots and movie remains
exiftool -d %Y%m%d/%Y-%m-%d-%Hh%Mm%S.%%e "-filename<datetimeoriginal" .
## for screenshots and movies of iPhone
for x in *.*; do
d=$(date -r "$x" +%Y%m%d)
mkdir -p "$d"
mv -- "$x" "$d/"
done
@billypchan
billypchan / UIInterfaceOrientation+description.swift
Created March 15, 2018 11:22
For printing UIInterfaceOrientation in Swift
extension UIInterfaceOrientation : CustomStringConvertible {
public var description: String {
switch self {
case .unknown: return "unknown"
case .portrait: return "portrait"
case .portraitUpsideDown: return "portraitUpsideDown"
case .landscapeLeft: return "landscapeLeft"