Skip to content

Instantly share code, notes, and snippets.

@ghawkgu
ghawkgu / FHlfi.markdown
Created April 27, 2014 18:14
A Pen by Yi Gu.
@ghawkgu
ghawkgu / gist:14e9698d267e849872cf
Created May 25, 2014 16:12 — forked from rozap/gist:10946749
Install elixir on Ubuntu
#!/bin/sh
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
sudo apt-add-repository -y ppa:bigkevmcd/elixir
sudo apt-get update
sudo apt-get install -y elixir
@ghawkgu
ghawkgu / smtp.py
Created April 26, 2011 13:58
Python smtp sample
#!/usr/bin/env python
import smtplib
mail_server = 'smtp.example.com'
mail_server_port = 465
from_addr = 'foo@example.com'
to_addr = 'bar@exmaple.com'
@ghawkgu
ghawkgu / boto_s3_sample.py
Created May 31, 2011 10:13
Writing into s3 with boto.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from boto.s3.connection import S3Connection
from boto.s3.key import Key
conn = S3Connection('access key', 'access secret')
bucket = conn.get_bucket('some-bucket')
# Write into 'mysql/test.txt'
@ghawkgu
ghawkgu / buildquerystring.m
Created July 22, 2011 04:01 — forked from chrishulbert/buildquerystring.m
Build a url query string in obj-c from a dictionary of params like jquery does
+(NSString*)urlEscape:(NSString *)unencodedString {
NSString *s = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)unencodedString,
NULL,
(CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",
kCFStringEncodingUTF8);
return [s autorelease]; // Due to the 'create rule' we own the above and must autorelease it
}
// Put a query string onto the end of a url
@ghawkgu
ghawkgu / private.xml
Created March 30, 2012 03:54
Customized mapping rules for keyRemap4MacBook to switch input source by one touch
<?xml version="1.0"?>
<root>
<item>
<name>Switch Input Source</name>
<appendix>Use the right Option key to select the next input source</appendix>
<identifier>private.switch_input_source_with_right_option</identifier>
<autogen>--KeyToKey-- KeyCode::OPTION_R, KeyCode::SPACE, ModifierFlag::OPTION_L | ModifierFlag::COMMAND_L</autogen>
</item>
<item>
@ghawkgu
ghawkgu / auto_increase_build_number.sh
Created March 31, 2012 07:20
Increase build number of an Xcode project for each build.
#! /bin/bash
# Increase build number for each build.
# Use "Run Script" to append this script into a project's scheme.
buildNumber=$(/usr/libexec/PlistBuddy -c "print CFBundleVersion" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist)
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "set :CFBundleVersion $buildNumber" ${PROJECT_DIR}/${PROJECT_NAME}/${PROJECT_NAME}-Info.plist
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
@ghawkgu
ghawkgu / README.md
Last active December 13, 2015 23:48
QQ iOS SDK Manual (v1.3)
@ghawkgu
ghawkgu / gist:5003326
Last active December 14, 2015 00:59
Tencent Weibo iOS SDK (v2.0) Manual

Tencent weibo (腾讯微博) iOS SDK マニュアル

中国語版へ

概要

SDKの機能概要

本SDKは下記の機能を含めています。

  • Tencent Weiboの認証(OAuth 2.0)
  • Tencent WeiboのAPI
  • 投稿、シェアモジュール