Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Yao Cheng alex-cellcity

  • CellCity Ltd.
  • Singapore
View GitHub Profile
View FlipView.podspec
Pod::Spec.new do |s|
s.name = "FlipView"
s.version = "0.0.1"
s.summary = "Magazine Style View/Layout like Flipboard."
s.homepage = "https://github.com/Reefaq/FlipView"
s.license = 'MIT'
s.author = { "Reefaq" => "Reefaq@Reefaq.com" }
s.source = { :git => "https://github.com/Reefaq/FlipView.git", :commit => "c2df511c6c5a98e9eb6b9ccfb57681a0f7af09a1" }
s.source_files = 'Classes/AFKPageFlipper.*', 'Classes/ColorHelper.{h,m}'
end
View add-book-to-pocket.rb
require "sinatra"
require "./lib/pocket.rb"
require "open-uri"
require "iconv"
require "json"
use Rack::Logger
helpers do
View PocketBook.rb
require "sinatra"
require "./lib/pocket.rb"
require "open-uri"
require "iconv"
require "json"
enable :sessions
CALLBACK_URL = "http://localhost:4567/oauth/callback"
View vfrReader.podspec
Pod::Spec.new do |s|
s.name = "vfrReader"
s.version = "2.6.2"
s.summary = "An open source PDF file reader/viewer for iOS."
s.homepage = "https://github.com/vfr/Reader"
s.license = 'MIT'
s.author = { "Julius Oklamcak" => "joklamcak@gmail.com" }
s.source = { :git => "https://github.com/vfr/Reader.git", :commit => "87a138c0b389d270807ee5fb82fdaf9516305aad" }
s.platform = :ios, '5.0'
s.source_files = 'Sources/**/*.{h,m}'
@alex-cellcity
alex-cellcity / PrettyKit.podspec
Created Apr 9, 2013
PrettyKit with ARC & iOS 6+
View PrettyKit.podspec
Pod::Spec.new do |s|
s.name = 'PrettyKit'
s.version = '0.3.0'
s.license = 'MIT'
s.summary = 'PrettyKit for iOS is a small set of new widgets and UIKit subclasses that gives you a deeper UIKit customization.'
s.homepage = 'http://github.com/vicpenap/PrettyKit'
s.author = { 'Victor Pena' => 'contact@victorpena.es' }
s.source = { :git => 'https://github.com/jessesquires/PrettyKit.git',
:branch => 'arc' }
s.description = 'PrettyKit for iOS is a small set of new widgets and UIKit subclasses that gives you a deeper UIKit customization. You will be able to change their background color, add gradients, shadows, etc.'
@alex-cellcity
alex-cellcity / sg-nric-validation.m
Created Feb 15, 2013
Singapore NRIC Validation
View sg-nric-validation.m
- (BOOL)validateNRIC:(NSString*)nric {
nric = [nric uppercaseString];
// NRIC length should be 9
if ([nric length]!=9) {
return NO;
}
//NRIC.charAt( 0 ) should be “S” or “T”
unichar prefix = [nric characterAtIndex:0];
View NVSlideMenuController.podspec
#
# Be sure to run `pod spec lint NVSlideMenuController.podspec' to ensure this is a
# valid spec.
#
# Remove all comments before submitting the spec. Optional attributes are commented.
#
# For details see: https://github.com/CocoaPods/CocoaPods/wiki/The-podspec-format
#
Pod::Spec.new do |s|
s.name = "NVSlideMenuController"
View UIMenuItem-CXAImageSupport.podspec
Pod::Spec.new do |s|
s.name = 'UIMenuItem-CXAImageSupport'
s.version = '0.0.1'
s.license = 'MIT'
s.summary = 'UIMenuItem with Image Support.'
s.homepage = 'https://github.com/cxa/UIMenuItem-CXAImageSupport'
s.author = 'cxa'
s.source = { :git => 'https://github.com/cxa/UIMenuItem-CXAImageSupport.git', :commit => 'a785911a' }
s.source_files = 'UIMenuItem+CXAImageSupport.{h,m}'
s.requires_arc = true
@alex-cellcity
alex-cellcity / cipa.sh
Created Jan 8, 2013
search udid inside .ipa file
View cipa.sh
#!/bin/bash
if [ $# == 1 ]
then
echo "UDIDs inside IPA: $1"
unzip -p "$1" Payload/\*.app/embedded.mobileprovision | grep -a "[a-z0-9]\{40\}"
elif [ $# == 2 ]
then
echo "Searching UDID: '$2' inside: '$1'"
unzip -p "$1" Payload/\*.app/embedded.mobileprovision | grep -a "[a-z0-9]\{40\}" | tr -d ' ' | grep "$2"
View plist_to_csv.rb
#!/usr/bin/env ruby
require 'plist'
require 'json'
require 'csv'
header = ['city_name', 'type', 'address', 'branch_name', 'lat', 'lon', 'phone']
csv = CSV.open('branches.csv', 'w', {force_quotes: true}) do |csv|
csv << header