Skip to content

Instantly share code, notes, and snippets.

View lingyi1105's full-sized avatar

Larry Zhang lingyi1105

View GitHub Profile
import UIKit
extension UIBezierPath {
// reference: https://github.com/erica/iOS-6-Cookbook/blob/master/C01%20Gestures/08%20-%20Smoothed%20Drawing/UIBezierPath-Points.m
var points: [CGPoint] {
var bezierPoints = [CGPoint]()
cgPath.applyWithBlock { (element: UnsafePointer<CGPathElement>) in
if element.pointee.type != .closeSubpath {
bezierPoints.append(element.pointee.points.pointee)
@lingyi1105
lingyi1105 / pullall.sh
Created August 25, 2021 10:11
git pull all remote branches
#!/bin/bash
git branch
current=$(git branch | grep '*')
echo ------
git branch -r | grep -v '\->'
echo ------
for remote in `git branch -r | grep -v '\->'`
@lingyi1105
lingyi1105 / clonefrom
Last active August 25, 2021 10:12
git clone from & copy pullall.sh
#!/bin/bash
if [ -n "$1" ]; then
name=${1##*/}
echo $name
folder=${name%.*}
echo $folder
# mkdir $folder
git clone $1
@lingyi1105
lingyi1105 / git-pull-all
Created August 25, 2021 09:55 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@lingyi1105
lingyi1105 / Apple_mobile_device_types.txt
Created January 13, 2021 08:27 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
iPhone5,1 : iPhone 5 (GSM)