Skip to content

Instantly share code, notes, and snippets.

View SheldonWangRJT's full-sized avatar
🎯
Focusing

Engineer Sheldon Wang SheldonWangRJT

🎯
Focusing
View GitHub Profile
@xeoncross
xeoncross / gitstats.sh
Created November 5, 2012 21:35
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
@cromandini
cromandini / universal-framework.sh
Last active February 12, 2024 12:13 — forked from cconway25/gist:7ff167c6f98da33c5352
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@webinista
webinista / RunAProxyOnAmazonEC2VPC.md
Last active April 17, 2024 05:58
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@SheldonWangRJT
SheldonWangRJT / Convert .mov or .MP4 to .gif.md
Last active April 23, 2024 12:20
Convert Movie(.mov) file to Gif(.gif) file in one command line in Mac Terminal

This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

Need

Convert .mov/.MP4 to .gif

Reason

As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.

This is not limited to developer, anyone has this need can use this method to convert the files.

@SheldonWangRJT
SheldonWangRJT / iOS Dynamic vs. Static Library & Framework.md
Last active November 14, 2022 04:07
iOS Dynamic vs. Static Library / Framework

iOS Dynamic vs. Static Library / Framework

Find me on Github, Facebook, Youtube, etc by #iOSBySheldon.

Concept

Library and Framework are not same but close. Frameworks are just libraries with linking (binding). In other words, frameworks are just libraries that are bundled into targets. Therefore, their file extensions are different.

File Format

  • Static Library - xxxx.a
  • Dynamic Library - xxxx.dylib
@embassem
embassem / Xcode Defaults.md
Created February 11, 2018 01:50 — forked from durul/Xcode Defaults.md
Xcode Defaults

Xcode Defaults

Command Line

# Enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

# Enable project build time
@SheldonWangRJT
SheldonWangRJT / WWDC18-416.md
Last active April 11, 2021 09:45
WWDC18 Notes by Sheldon - Session 416 - iOS Memory Deep Dive

WWDC18 Notes - Session 416 - iOS Memory Deep Dive

All session list link: Here
Session Link: Here
Demo starts @ 25:30 in the video.
Download session slides: Here

This notes is written by Sheldon after watching WWDC18 session 416. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

@SheldonWangRJT
SheldonWangRJT / iPhone_device_names_types_resolutions.md
Last active August 6, 2022 16:03
iPhone device names, types, resolutions, aspect ratio, scale, PPI

iOS Device Types, Names, Resolutions (points)

DEVICE TYPE PRODUCT NAME RESOLUTION (PIXEL) UIKIT SIZE (POINT) ASPECT RATIO (H:W) UIKIT SCALE PIXEL PER INCH (PPI)
iPhone1,1 iPhone 320 x 480 320 x 480 1.5 1.0 163
iPhone1,2 iPhone 3G 320 x 480 320 x 480 1.5 1.0 163
iPhone2,1 iPhone 3GS 320 x 480 320 x 480 1.5 1.0 163
iPhone3,1 iPhone 4 (GSM) 320 x 480 640 x 960 1.5 2.0 326
iPhone3,3 iPhone 4 (CDMA) 320 x 480 640 x 960 1.5 2.0 326
iPhone4,1 iPhone 4S 320 x 480 640 x 960 2.0 1.5 326