Skip to content

Instantly share code, notes, and snippets.

On vacation

Powhu Yang powhu

On vacation
  • Tokyo
View GitHub Profile
powhu / gist:59fb71a7b501776a0b2cd96142cf7d95
Last active May 27, 2020
iTunes connect video preview
View gist:59fb71a7b501776a0b2cd96142cf7d95
// iPhone X
ffmpeg -i -qscale 0 -r 24 -y -vf scale=886:1920,setsar=1:1
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i -y -vf scale=886:1920 -map 0:0 -map 1:0 -shortest -strict experimental -r 30 -y appstore.mp4
// iPhone 8 plus
ffmpeg -i -qscale 0 -r 24 -y -vf scale=1080:1920,setsar=1:1
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i -y -vf scale=1080:1920 -map 0:0 -map 1:0 -shortest -strict experimental -r 30 -y appstore.mp4
View Swift4 Operation Sample
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class MyOperation: Operation {
enum State {
case ready, executing, finished
var keyPath: String {
powhu / GIF2MP4.swift
Last active Nov 10, 2022
Swift 5.0 GIF to MP4
View GIF2MP4.swift
// GIF2MP4.swift
// Created by PowHu Yang on 2020/4/24.
// Copyright © 2020 PowHu Yang. All rights reserved.
/* How to use
let data = try! Data(contentsOf: Bundle.main.url(forResource: "gif", withExtension: "gif")!)
let tempUrl = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("temp.mp4")
View XCode hidden options
## Show build time
defaults write ShowBuildOperationDuration YES
## Fuzzy complete
defaults write IDECodeCompletionFuzzyMode 3
defaults write IDEWorkaroundForRadar6288283 3
## multi-core CPU
defaults write IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`
powhu / XCodeUUID
Created Apr 17, 2015
Add new XCode UUID for all plugins
View XCodeUUID
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist | xargs -IFILE defaults write FILE DVTPlugInCompatibilityUUIDs -array-add <-UUID->