Skip to content

Instantly share code, notes, and snippets.


Wasin Thonkaew haxpor

View GitHub Profile
xcode-select -s /Applications/
View .tmux.conf
unbind C-b
set -g prefix C-'\'
bind C-'\' send-prefix
haxpor / .slate
Created Jul 7, 2015
slate config file
View .slate
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0
haxpor / zhbuild
Last active Jul 4, 2019
A handy shell (bash) script to manage (build, export build setting, and deploy) Zombie Hero project
View zhbuild
## A simple shell script to build Zombie Hero Project from command line
## It involves using the following programs
## 1. xcodebuild
## 2. ios-deploy
## Commands support (*specific for this script and project)
View UnityNativeInterface.m
// UnityNativeInterface.m
// Unity-iPhone
// Created by Sam Izzo on 30/05/14.
#import "UnityInterface.h"
#import "UnityNativeInterface.h"
View UnityViewControllerBase.h
#pragma once
@class UnityView;
@interface UnityViewControllerBase : UIViewController
- (BOOL)shouldAutorotate;
- (BOOL)prefersStatusBarHidden;
View gist:50c3ae54e69ebc6f87c8
// Prepare by adding to the top window.
NSEnumerator *frontToBackWindows = [[[UIApplication sharedApplication] windows] reverseObjectEnumerator];
for (UIWindow *window in frontToBackWindows) {
if (window.windowLevel == UIWindowLevelNormal) {
[window addSubview:self];
haxpor / ConstraintsInCode.m
Created Sep 29, 2015
Create iOS constraints in code
View ConstraintsInCode.m
UIView* contentView = [[UIView alloc] init];
contentView.translatesAutoresizingMaskIntoConstraints = NO;
contentView.backgroundColor = [UIColor grayColor];
contentView.layer.cornerRadius = 12.0;
UILabel* statusLabel = [[UILabel alloc] init];
statusLabel.translatesAutoresizingMaskIntoConstraints = NO;
statusLabel.backgroundColor = [UIColor clearColor];
statusLabel.textColor = [UIColor whiteColor];
View install-curl-php5-steps.txt
Open SSH
1. First Install CURL by typing sudo apt-get install curl
2. Then Restart Apache by typing sudo service apache2 restart
3. Then Install PHP5 CURL by typing sudo apt-get install php5-curl
4. will prompt to install... type y or yes!
5. Then Restart Apache by typing sudo service apache2 restart Done!
Now you should be fine!
haxpor / gist:a44585fc49e1ae03edb1
Created Jan 15, 2016
get UIImage from CCRenderTexture
View gist:a44585fc49e1ae03edb1
+(UIImage *)getUIImageOfGeneratedScore
CCSprite *socialShare = CCSprite::create("../bg-social-share.png");
int textureWidth = socialShare->getContentSize().width;
int textureHeight = socialShare->getContentSize().height;
socialShare->setPosition(ccp(textureWidth/2, textureHeight/2));
CCRenderTexture* renderer = CCRenderTexture::create(textureWidth, textureHeight);