Skip to content

Instantly share code, notes, and snippets.

View hikui's full-sized avatar

Henry H Miao hikui

View GitHub Profile
@hikui
hikui / tsconfig.json
Created February 15, 2019 12:12
tsconfig for RN
{
"compilerOptions": {
/* Basic Options */
"target": "es2015",
"module": "es2015",
"lib": ["es2015"],
"jsx": "react-native",
"rootDir": "./",
"noEmit": true,
"strict": true,
@hikui
hikui / increase_build_version.sh
Created May 21, 2017 07:44
Increase the Build Version When Building Release Configuration
#!/bin/bash
if [ "${CONFIGURATION}" = "Release" ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
fi
@hikui
hikui / ShellViewController.swift
Created May 21, 2017 07:34
Shell View Controller for a New App
//
// ShellViewController.swift
// Danta-iOS-App
//
// Created by Henry Heguang Miao on 21/5/17.
// Copyright © 2017 Henry Miao. All rights reserved.
//
import UIKit
#!/bin/bash
wget http://d3kbcqa49mib13.cloudfront.net/spark-2.0.0-bin-hadoop2.7.tgz
tar -zxf spark-2.0.0-bin-hadoop2.7.tgz
mv spark-2.0.0-bin-hadoop2.7 spark
#!/bin/bash
sudo apt-get update
sudo apt-get install -y default-jdk
sudo apt-get remove -y scala-library scala
sudo wget http://downloads.lightbend.com/scala/2.11.8/scala-2.11.8.deb
sudo dpkg -i scala-2.11.8.deb
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
sudo apt-get update
sudo apt-get install -y sbt
'''
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
@hikui
hikui / SimpleHTTPServerWithUpload.py
Created October 19, 2015 05:27 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
//
// NSAttributedString+Attributes.h
// A category for NSAttributedString and NSMutableAttributedString to easily get or set sub-attributes.
//
// Created by Shilo White on 9/22/13.
// Copyright (c) 2013 XIDA Design & Technik. All rights reserved.
//
#import <Foundation/Foundation.h>
@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;
#!/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