Skip to content

Instantly share code, notes, and snippets.

View haxpor's full-sized avatar
🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller

Wasin Thonkaew haxpor

🤓
Some of my financial tools https://www.mql5.com/en/users/haxpor/seller
View GitHub Profile
@haxpor
haxpor / xcode-select.sh
Created July 4, 2015 03:30
Change xcode path
xcode-select -s /Applications/Xcode.app/Contents/Developer
@haxpor
haxpor / .tmux.conf
Created July 7, 2015 20:35
tmux config
unbind C-b
set -g prefix C-'\'
bind C-'\' send-prefix
@haxpor
haxpor / .slate
Created July 7, 2015 20:38
slate config file
# 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
haxpor / zhbuild
Last active April 27, 2022 11:29
A handy shell (bash) script to manage (build, export build setting, and deploy) Zombie Hero project
#!/bin/bash
## 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)
##
//
// UnityNativeInterface.m
// Unity-iPhone
//
// Created by Sam Izzo on 30/05/14.
//
//
#import "UnityInterface.h"
#import "UnityNativeInterface.h"
#pragma once
@class UnityView;
@interface UnityViewControllerBase : UIViewController
{
}
- (BOOL)shouldAutorotate;
- (BOOL)prefersStatusBarHidden;
@haxpor
haxpor / gist:50c3ae54e69ebc6f87c8
Created September 29, 2015 10:10
Get the top UIWindow as seen in KLCPopup (https://github.com/jmascia/KLCPopup)
// Prepare by adding to the top window.
if(!self.superview){
NSEnumerator *frontToBackWindows = [[[UIApplication sharedApplication] windows] reverseObjectEnumerator];
for (UIWindow *window in frontToBackWindows) {
if (window.windowLevel == UIWindowLevelNormal) {
[window addSubview:self];
break;
}
@haxpor
haxpor / ConstraintsInCode.m
Created September 29, 2015 12:24
Create iOS constraints in code
...
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];
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
haxpor / gist:a44585fc49e1ae03edb1
Created January 15, 2016 17:01
get UIImage from CCRenderTexture
+(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);
renderer->begin();