Skip to content

Instantly share code, notes, and snippets.

View youngshook's full-sized avatar
🐝
Working

YoungShook youngshook

🐝
Working
View GitHub Profile
@youngshook
youngshook / updateXcodeBuildVersion.sh
Created April 20, 2014 16:00
update XcodeBuildVersion when Archive
if [ $CONFIGURATION == Release ]; then
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
#increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
fi
@youngshook
youngshook / PaintingBarButton.m
Last active August 29, 2015 14:01
Painting UIBarButton Image
- (UIImage *)backButtonImage
{
static UIImage *image;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
CGSize size = CGSizeMake(50.0, 44.0);
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
[[UIColor whiteColor] setStroke];
@youngshook
youngshook / NSObject+Reflection.m
Created May 30, 2014 15:16
Auto To Object Reflection
#import "NSObject+Reflection.h"
#import <objc/runtime.h>
@implementation NSObject (Reflection)
- (NSArray *)propertyKeys
{
unsigned int outCount, i;
objc_property_t *properties = class_copyPropertyList([self class], &outCount);
NSMutableArray *keys = [[NSMutableArray alloc] initWithCapacity:outCount];
@youngshook
youngshook / archiveIconVersioning.sh
Created June 22, 2014 16:12
Auto overlaying icon when app Archive action
#/bin/sh
export PATH=/opt/local/bin/:/opt/local/sbin:$PATH:/usr/local/bin:
DATE=$( /bin/date +"%Y-%m-%d" )
ARCHIVE=$( /bin/ls -t "${HOME}/Library/Developer/Xcode/Archives/${DATE}" | /usr/bin/grep xcarchive | /usr/bin/sed -n 1p )
APP="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/Products/Applications/${PRODUCT_NAME}.app"
APPID=$(/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "${APP}/Info.plist")
LOG="/tmp/iconVersioning.log"
/bin/rm "/tmp/iconVersioning.log"
@youngshook
youngshook / buildIconVersioning.sh
Created June 22, 2014 16:12
App build overlaying icon version
export PATH=/opt/local/bin/:/opt/local/sbin:$PATH:/usr/local/bin:
convertPath=`which convert`
echo ${convertPath}
if [[ ! -f ${convertPath} || -z ${convertPath} ]]; then
echo "WARNING: Skipping Icon versioning, you need to install ImageMagick and ghostscript (fonts) first, you can use brew to simplify process:
brew install imagemagick
brew install ghostscript"
exit 0;
fi
@youngshook
youngshook / curl.md
Created July 6, 2014 12:13 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@youngshook
youngshook / VPS_PPTP.sh
Last active August 29, 2015 14:03
Deploy pptp vpn in VPS
#!/bin/sh
#! via https://www.digitalocean.com/community/tutorials/how-to-setup-your-own-vpn-with-pptp
if [ `id -u` -ne 0 ]
then
echo "please run it by root"
exit 0
fi
 
apt-get -y update
@youngshook
youngshook / BuildPhrases_ refactoring.sh
Created July 19, 2014 09:12
Warning File more than 400 lines in Xcode
find "${SRCROOT}" \( -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -
print0 \) | xargs -0 wc -l | awk '$1 > 400 && $2 != "total" {for(i=2;i<NF;i++){printf "%s%s", $i, " "} print $NF ":1: warning: File more than 400 lines (" $1 "), consider refactoring." }'
@youngshook
youngshook / BuildPhrasesXToDo.sh
Created July 19, 2014 09:14
Warning TODO/FIXME Tips in Xcode
KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server: