Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Powhu Yang powhu

🌴
On vacation
  • Tokyo
View GitHub Profile
@powhu
powhu / gist:59fb71a7b501776a0b2cd96142cf7d95
Last active May 27, 2020
iTunes connect video preview
View gist:59fb71a7b501776a0b2cd96142cf7d95
// iPhone X
ffmpeg -i input.mov -qscale 0 -r 24 -y -vf scale=886:1920,setsar=1:1 output.mov
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i output.mov -y -vf scale=886:1920 -map 0:0 -map 1:0 -shortest -strict experimental -r 30 -y appstore.mp4
// iPhone 8 plus
ffmpeg -i input.mov -qscale 0 -r 24 -y -vf scale=1080:1920,setsar=1:1 output.mov
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i output.mov -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
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 com.apple.dt.Xcode ShowBuildOperationDuration YES
## Fuzzy complete
defaults write com.apple.dt.Xcode IDECodeCompletionFuzzyMode 3
defaults write com.apple.dt.Xcode IDEWorkaroundForRadar6288283 3
## multi-core CPU
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`
@powhu
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->