Skip to content

Instantly share code, notes, and snippets.

View kukat's full-sized avatar

Cheng Yao kukat

View GitHub Profile
@kukat
kukat / MHTabBarController.podspec
Last active December 10, 2015 22:29
MHTabBarController.podspec
Pod::Spec.new do |s|
s.name = "MHTabBarController"
s.version = "1.0.0"
s.summary = "A custom tab bar controller for iOS 5."
s.description = <<-DESC
This is a custom container view controller for iOS 5 that works just like a regular UITabBarController, except the tabs are at the top and look different.
DESC
s.homepage = "http://www.hollance.com/2011/11/mhtabbarcontroller-a-custom-tab-bar-for-ios-5-using-the-new-container-apis/"
s.license = { :type => 'MIT', :text => 'The MHTabBarController source code is copyright 2011 Matthijs Hollemans and is licensed under the terms of the MIT license.' }
s.author = { "Matthijs Hollemans" => "[email protected]" }
/*
* 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)
@kukat
kukat / MarqueeLabel.podspec
Created January 26, 2013 13:32
MarqueeLabel podspec
#
# Be sure to run `pod spec lint MarqueeLabel.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 = "MarqueeLabel"
@kukat
kukat / custom.css
Last active November 14, 2016 13:49
nvAlt with code highlight template.html
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@kukat
kukat / MHTabBarController+Jeksys.podspec
Created April 24, 2013 14:20
MHTabBarController Jeksys' Fork
MHTabBarController+Jeksys
@kukat
kukat / MHTabBarController+Jeksys.podspec
Created April 24, 2013 14:21
MHTabBarController Jeksys' Fork
Pod::Spec.new do |s|
s.name = "MHTabBarController+Jeksys"
s.version = "0.1.1"
s.summary = "A custom tab bar controller for iOS 5. Jeksys' fork"
s.description = <<-DESC
This is a custom container view controller for iOS 5 that works just like a regular UITabBarController, except the tabs are at the top and look different.
DESC
s.homepage = "http://www.hollance.com/2011/11/mhtabbarcontroller-a-custom-tab-bar-for-ios-5-using-the-new-container-apis/"
s.license = { :type => 'MIT', :text => 'The MHTabBarController source code is copyright 2011 Matthijs Hollemans and is licensed under the terms of the MIT license.' }
s.author = { "Matthijs Hollemans" => "[email protected]" }
@kukat
kukat / keyboardFrameChanged.m
Created April 25, 2013 15:51
ios keyboard notification
#pragma mark - reg & unreg notification
- (void)regNotification
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
}
- (void)unregNotification
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillChangeFrameNotification object:nil];
@kukat
kukat / jdpromocode.sh
Created July 18, 2013 15:38
JD SG promo code
#!/bin/bash
echo "check JD.com promo code\n"
$cmd
for i in {1..100}
do
code=$(printf 'SGCUSTOMEREXP%03i' $i)
echo ">>$i: $code \n"
@kukat
kukat / isapi_rewrite.ini
Created July 23, 2013 15:25
isapi rewrite
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.82
RewriteCond Host: (.+)
RewriteCond %{HTTP:Host}#%{HTTP:Referer} ^([^#]+)#(?!http://\1).+
RewriteCond Referer: (?!http://(.*)(YOURDOMAIN\.com)).*
RewriteRule .*\.(?:gif|jpg|png) /badlink.png [I,O,N]
@kukat
kukat / N56U_iperf_test.txt
Created July 23, 2013 16:31
N56U iperf test
QNAP$ iperf -c 192.168.1.4 -w 128k -t 60 -P 5
------------------------------------------------------------
Client connecting to 192.168.1.4, TCP port 5001
TCP window size: 220 KByte (WARNING: requested 128 KByte)
------------------------------------------------------------
[ 4] local 192.168.1.2 port 44510 connected with 192.168.1.4 port 5001
[ 5] local 192.168.1.2 port 44511 connected with 192.168.1.4 port 5001
[ 6] local 192.168.1.2 port 44512 connected with 192.168.1.4 port 5001
[ 3] local 192.168.1.2 port 44509 connected with 192.168.1.4 port 5001
[ 7] local 192.168.1.2 port 44513 connected with 192.168.1.4 port 5001