Skip to content

Instantly share code, notes, and snippets.

@shanshiwu
shanshiwu / linkmap.js
Created April 6, 2019 00:16 — forked from bang590/linkmap.js
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
@shanshiwu
shanshiwu / README-Template.md
Created November 15, 2018 13:42 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@shanshiwu
shanshiwu / README.md
Created May 2, 2017 05:54 — forked from acrookston/README.md
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@shanshiwu
shanshiwu / JAZMusician.h
Created February 18, 2017 01:44 — forked from jpsim/JAZMusician.h
SourceKit Playground
//
// JAZMusician.h
// JazzyApp
//
#import <Foundation/Foundation.h>
/**
JAZMusician models, you guessed it... Jazz Musicians!
From Ellington to Marsalis, this class has you covered.
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@shanshiwu
shanshiwu / open_app.html
Created December 1, 2016 10:01 — forked from noelrocha/open_app.html
Open app on Google Play or AppStore
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Open App</title>
<!--
URL Params:
customSchemeURL: Your custom scheme app
@shanshiwu
shanshiwu / gist:ce08ceaee9552d2f995aa9afc1ee02e4
Created December 1, 2016 03:54 — forked from alexandreraulin/gist:f4b1504aec9d25f5af08
Script for iOS Universal Framework compilation with Xcode 6
# This script is based on Jacob Van Order's answer on apple dev forums https://devforums.apple.com/message/971277
# See also http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ for the start
# To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework
# Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate
######################
# Options
@shanshiwu
shanshiwu / build.sh
Created November 21, 2016 14:12 — forked from madhikarma/build.sh
xcodebuild script
#!/bin/sh
set -eo pipefail
IFS=$'\n\t'
# Constants
NOW=$(date +%s)
BUILD_FILE_NAME="MyApp-${NOW}"
SCHEME="MyApp"
WORKSPACE="MyApp"
PROJECT="MyApp"
@shanshiwu
shanshiwu / ThanksTimCook
Created November 21, 2016 10:45 — forked from jacobvanorder/ThanksTimCook
Bash Shell Script for Xcode Aggregate Target for new Xcode 6 Framework/Module
#Thanks to http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ for the start
#To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework
#Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate
#Tip: if you want the resulting framework to be the same name as your Framework, change the Aggregate's product name
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PRODUCT_NAME}.framework"
DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PRODUCT_NAME}.framework"
UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"
FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${PRODUCT_NAME}.framework"
@shanshiwu
shanshiwu / convert-to-ipad.rb
Created October 15, 2016 07:45 — forked from pcreux/convert-to-ipad.rb
ffmpeg - avi to mp4 - iPad
# ruby convert-to-ipad.rb video1.avi video2.avi video3.avi
#
# Prereq: brew install ffmpeg
ARGV.each do |input_file|
output_file = input_file.gsub('.avi', '.ipad.mp4')
cmd = "ffmpeg -i #{input_file} -acodec aac -ac 2 -strict experimental -ab 160k -s 1024x768 -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 #{output_file}"
puts cmd
system cmd
end