Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Yao Cheng alex-cellcity

  • CellCity Ltd.
  • Singapore
View GitHub Profile
@alex-cellcity
alex-cellcity / Version.m
Created May 30, 2011
Runtime iOS Version Checking
View Version.m
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
@alex-cellcity
alex-cellcity / Gemfile
Created Aug 3, 2012
Gemfile for tnpfk api
View Gemfile
source 'http://rubygems.org'
gem 'actionmailer', '2.3.8'
gem 'actionpack', '2.3.8'
gem 'activerecord', '2.3.8'
gem 'activeresource', '2.3.8'
gem 'activesupport', '2.3.8'
gem 'addressable', '2.2.6'
gem 'akami', '1.0.0'
gem 'apns', '0.9.0'
View git build version
#!/bin/bash
release=`git tag | tail -n 1`
if [ -n release ]; then
release="1.0"
fi
build=`git log --oneline HEAD | wc -l | awk '{print $1 }'`
# build=`git log -n1 --date=short --format="%ad (%h)"`
# Shows 2012-04-24 (5fb42cb)
View NSData+AESCrypt.h
//
// NSData+AESCrypt.h
//
// AES Encrypt/Decrypt
// Created by Jim Dovey and 'Jean'
// See http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html
//
// BASE64 Encoding/Decoding
// Copyright (c) 2001 Kyle Hammond. All rights reserved.
// Original development by Dave Winer.
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.'