Skip to content

Instantly share code, notes, and snippets.

View hikui's full-sized avatar

Henry H Miao hikui

View GitHub Profile
@hikui
hikui / color.py
Last active December 10, 2015 21:18
你永远不知道颜色在别人大脑中的反映是不是和自己一样
#coding:utf-8
class Object:
pass
class Person:
def __init__(self):
self.feeling_colorname_map = dict()
self.wavelength_feeling_map = dict()
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@hikui
hikui / Availability
Last active December 20, 2015 19:28
iOS支持低版本时,监测函数是否用的太新
//
// MJGImageLoader.h
// MJGFoundation
//
// Created by Matt Galloway on 18/01/2012.
// Copyright 2012 Matt Galloway. All rights reserved.
//
/**
* Example usage:
.. .vr
qBMBBBMBMY
8BBBBBOBMBMv
iMBMM5vOY:BMBBv
.r, OBM; .: rBBBBBY
vUL 7BB .;7. LBMMBBM.
.@Wwz. :uvir .i:.iLMOMOBM..
vv::r; iY. ...rv,@arqiao.
Li. i: v:.::::7vOBBMBL..
,i7: vSUi, :M7.:.,:u08OP. .
/*
#####################################################################
# File : MHGSwipeNavigationController.h
# Project : StockBar
# Created : 13-12-30
# DevTeam : Thomas
# Author : 缪 和光
# Notes :
#####################################################################
### Change Logs ###################################################
//
// MHGSwipeNavigationController.h
// SwipeNavigationController
//
// Created by 缪和光 on 28/12/2013.
// Copyright (c) 2013 Hokuang. All rights reserved.
//
#import <UIKit/UIKit.h>
@hikui
hikui / NSData+HG_DataHealing.h
Last active November 5, 2017 13:15
如果在GB18030编码的文字中,有几个不合法的字节。本类可以将这些不合法的字节变成“?”,防止转NSString时出现nil。
//
// NSData+HG_DataHealing.h
// HGDataHealing
//
// Created by 缪 和光 on 14-3-7.
// Copyright (c) 2014年 Hokuang. All rights reserved.
//
#import <Foundation/Foundation.h>
// Author: Oleg Andreev <oleganza@gmail.com>
// May 28, 2011
// Do What The Fuck You Want Public License <http://www.wtfpl.net>
#import "NSData+OADataHelpers.h"
#if !__has_feature(objc_arc)
#error ARC must be enabled!
#endif
#!/usr/local/bin/ruby
# encoding: UTF-8
require 'yaml'
require "base64"
require 'rexml/document'
class PList < BasicObject
ELEMENT_PROCESSORS = {}
def self.process_element_named(name, &block); ELEMENT_PROCESSORS[name.to_s] = block; end
def self.process_element(elt) ; ELEMENT_PROCESSORS[elt.name][elt]; end
@hikui
hikui / SBGetAccurateNetworkReachability
Last active August 29, 2015 14:13
Determine mobile network technology(e.g. 2G, 3G, 4G)
static CTTelephonyNetworkInfo * __telephonyNetworkInfo;
SBNetworkReachability SBGetAccurateNetworkReachability()
{
SBNetworkReachability reachability = SBGetNetworkReachability();
if (reachability == SBNetworkReachabilityMobile) {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) {
if (!__telephonyNetworkInfo) {
__telephonyNetworkInfo = [CTTelephonyNetworkInfo new];
}
NSString * radioAccessTechnology = __telephonyNetworkInfo.currentRadioAccessTechnology;