Skip to content

Instantly share code, notes, and snippets.

@ewangke
ewangke / manage_simplehttpserver.sh
Created June 9, 2012 21:20 — forked from wxianfeng/manage_simplehttpserver.sh
manage python SimpleHTTPServer for serve page
#!/bin/bash
##
# start|stop|restart python SimpleHTTPServer
#
# TODO:
# use shell Function for DRY
# USAGE:
# ./manage_simplehttpserver.sh start|stop|restart
#
@ewangke
ewangke / GifExportor.m
Created June 9, 2012 21:22 — forked from akisute/gist:1141953
Create an animated gif file from images in iOS
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
- (void)exportAnimatedGif
{
UIImage *shacho = [UIImage imageNamed:@"shacho.png"];
UIImage *bucho = [UIImage imageNamed:@"bucho.jpeg"];
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"animated.gif"];
@ewangke
ewangke / sublime_text_2_shortcut_cn.txt
Created June 9, 2012 21:50
Sublime Text 2快捷键
打开/前往
⌘T 前往文件
⌘⌃P 前往项目
⌘R 前往 method
⌘⇧P 命令提示
⌃G 前往行
⌘KB 开关侧栏
⌃ ` python 控制台
⌘⇧N 新建窗口
@ewangke
ewangke / subl_shortcut.md
Created June 9, 2012 23:13 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

h1. Sublime Text 2 - Useful Shortcuts (Mac OS X)

h2. General

| ⌘T | go to file | | ⌘⌃P | go to project | | ⌘R | go to methods | | ⌃G | go to line | | ⌘KB | toggle side bar | | ⌘⇧P | command prompt |

@ewangke
ewangke / pptpinstall.sh
Created July 14, 2012 10:19
Install PPTP vpn server on Xen Ubuntu
#!/bin/bash
# Interactive PoPToP install script on a OpenVZ VPS
# Tested on Debian 5, 6, and Ubuntu 11.04
# 2011 v1.1
# Author: Commander Waffles
# http://www.putdispenserhere.com/pptp-debian-ubuntu-openvz-setup-script/
echo "######################################################"
echo "Interactive PoPToP Install Script for OpenVZ VPS"
echo "by Commander Waffles http://www.putdispenserhere.com"
@ewangke
ewangke / setup-debian.sh
Created July 14, 2012 20:31
LNMP based Wordpress install script modified from LowEndBox's script
#!/bin/bash
function check_install {
if [ -z "`which "$1" 2>/dev/null`" ]
then
executable=$1
shift
while [ -n "$1" ]
do
DEBIAN_FRONTEND=noninteractive apt-get -q -y install "$1"
@ewangke
ewangke / requirements.txt
Created July 28, 2012 10:12
bottle with pymongo and mongoengine on AppFog
bottle
pymongo
mongoengine
@ewangke
ewangke / PlayHavenSDK.podspec
Last active December 16, 2015 09:09
Advanced CocoaPods - Local Dependency
Pod::Spec.new do |s|
s.name = 'PlayHavenSDK'
s.version = '1.12.1'
s.license = 'MIT'
s.summary = 'PlayHaven is a real-time mobile game marketing platform to help you take control of the business of your games.'
s.homepage = 'http://playhaven.com'
s.author = { 'Sam Stewart' => '[email protected]' }
s.source = { :git => 'https://github.com/playhaven/sdk-ios.git', :tag => '1.12.1' }
s.description = "PlayHaven is a real-time mobile game marketing platform to help you take control of the business of your games. Acquire, retain, re-engage, and monetize your players with the help of PlayHaven's powerful marketing platform. Integrate once and embrace the flexibility of the web as you build, schedule, deploy, and analyze your in-game promotions and monetization in real-time through PlayHaven's easy-to-use, web-based dashboard. An API token and secret is required to use this SDK. These tokens uniquely identify your app to PlayHaven and prevent others from making requests to the API on you
@ewangke
ewangke / ChartboostSDK.podspec
Created April 18, 2013 09:04
Advanced CocoaPods - Local Dependency
Pod::Spec.new do |s|
s.name = 'ChartboostSDK'
s.version = '3.1.1'
s.license = 'Commercial'
s.summary = 'ChartboostSDK for showing ads and more apps pages, and tracking analytics and in-app purchase revenue.'
s.homepage = 'https://chartboost.com/'
s.author = { 'Chartboost' => 'https://chartboost.com/' }
s.source = { :git => '~/Desktop/ChartboostSDK' }
s.platform = :ios
s.source_files = '**/*.h'
@ewangke
ewangke / UDIDMigration.m
Created June 27, 2013 13:39
UDID migration for unique identifier within a specific app
NSString *UUID = [[NSUserDefaults standardUserDefaults] objectForKey:kApplicationUUIDKey];
if (!UUID) {
CFUUIDRef uuid = CFUUIDCreate(NULL);
UUID = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid);
CFRelease(uuid);
[[NSUserDefaults standardUserDefaults] setObject:UUID forKey:kApplicationUUIDKey];
[[NSUserDefaults standardUserDefaults] synchronize];
}