Skip to content

Instantly share code, notes, and snippets.

View kukat's full-sized avatar

Cheng Yao kukat

View GitHub Profile
@kukat
kukat / xcode.rb
Last active September 13, 2016 07:18 — forked from derencius/xcode.rb
aria2 downloader
require 'rubygems'
require 'mechanize'
if ARGV.size < 3
puts %q{Usage: ruby xcode.rb USERNAME PASSWORD "DOWNLOAD_URL" [WGET_PARAMS]}
puts %q{Example: ruby xcode.rb [email protected] 123456 "https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/xcode_4_and_ios_sdk_4.3__final/xcode_4_and_ios_sdk_4.3__final.dmg" }
exit
end
a = Mechanize.new { |agent|
@kukat
kukat / books.txt
Created August 28, 2013 07:15
books.txt
中外广告妙语金句10000条_文字版_小开本.pdf == http://u.115.com/file/f2253728c2
海上幽灵-世界隐秘作战舰艇解密_文字版_小开本.pdf == http://u.115.com/file/f260e1b00e
陆地雄狮-世界军用战车解密_文字版_小开本.pdf == http://u.115.com/file/f217e6e09c
货币、信用与商业_马歇尔_文字版_小开本.pdf == http://u.115.com/file/f21e151aaa
徐向前军事文选_文字版_小开本.pdf == http://u.115.com/file/f2c9aee227
@kukat
kukat / xcode2ipa.sh
Created August 29, 2013 09:45
xcode command line build & archive .ipa
# Clean & Build .app
/usr/bin/xcodebuild -scheme PROJECT -workspace PROJECT.xcworkspace -configuration Release clean build CONFIGURATION_BUILD_DIR=${WORKSPACE}/build
# Sign & Pack .ipa
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/build/${APPLICATION_NAME}.app" -o "${WORKSPACE}/build/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"
#!/bin/bash
if [ $# == 1 ]
then
echo "UDIDs inside IPA: $1"
unzip -p "$1" Payload/\*.app/embedded.mobileprovision | grep -a "[a-f0-9]\{40\}"
elif [ $# == 2 ]
then
echo "Searching UDID: '$2' inside: '$1'"
unzip -p "$1" Payload/\*.app/embedded.mobileprovision | grep -a "[a-f0-9]\{40\}" | tr -d ' ' | grep "$2"
{"connection":"keep-alive","ip_addr":"202.63.156.188","lang":"en-US,en;q=0.8,zh;q=0.6,zh-CN;q=0.4","remote_host":"188.202-63-156.ngn.m1net.com.sg","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36","charset":"","port":"62863","via":"","forwarded":"","mime":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8","keep_alive":"","encoding":"gzip,deflate,sdch"}
@kukat
kukat / OS X Development Environment Setup.md
Created March 17, 2014 16:06
OS X Development Environment Setup

OS X Development Environment Setup

Basic

Install Command Line Tools

xcode-select -- install
@kukat
kukat / imageset.sh
Created April 2, 2014 10:50
Xcode 5 imageset generator
#!/usr/bin/env bash
SOURCE_PATH=$1
for f in "$SOURCE_PATH"/*.png; do
fullname=$(basename "$f")
filename=${fullname%@2x.*}
imageset="$SOURCE_PATH"/"$filename".imageset
jsonfile="$imageset"/Contents.json
@kukat
kukat / UINavigationBarTitle+Icon.m
Last active March 31, 2021 15:42
UINavigationBar Title with Image
// Icon
UIImage *headerIcon = [UIImage imageNamed:@"store32"];
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = headerIcon;
NSAttributedString *icon = [NSAttributedString attributedStringWithAttachment:textAttachment];
// space between icon and title
NSAttributedString *space = [[NSAttributedString alloc] initWithString:@" "];
// Title
# Install a Webserver
apt-get -y install apache2
# Target docroot to /home/satis/web/
# Install PHP5 CLI and needed programs.
apt-get -y install php5-cli php5-curl php5-json git wget
# Add a specifix user for our task
adduser satis
@kukat
kukat / APIController.php
Last active August 29, 2015 14:01
Yii + oauth2-server-php
<?php
Yii::import('application.vendor.*');
require_once('oauth2-server-php/src/OAuth2/Autoloader.php');
class APIController extends Controller
{
protected $oauth_server;