Skip to content

Instantly share code, notes, and snippets.

View ondev's full-sized avatar

Haven Tang ondev

View GitHub Profile
@ondev
ondev / gist:6714742
Created September 26, 2013 14:08
iOS Common Macro
//
// CommonMacro.h
//
//
// Created by Haven on 26/9/13.
// Copyright (c) 2013 LF. All rights reserved.
//
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#!/bin/bash
echo Building Google Protobuf for Mac OS X / iOS.
#echo Use 'tail -f build.log' to monitor progress.
#(
PREFIX=`pwd`/protobuf
mkdir ${PREFIX}
mkdir ${PREFIX}/platform
@ondev
ondev / 0_reuse_code.js
Created October 29, 2015 09:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ondev
ondev / iOS mutilpart post
Created January 13, 2016 04:37
iOS mutilpart post
// Set content type to be form data
NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request addValue:contentType forHTTPHeaderField:@"Content-Type"];
// Set content type to be form data
NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request addValue:contentType forHTTPHeaderField:@"Content-Type"];