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 / SMAA.fx
Created July 8, 2012 03:51
Modified version of SMAA effect files to make it able to be compiled and run on XNA 3.1. Original sources taken from https://github.com/iryoku/smaa. NOTE: The code seen here don't work yet, it can be compiled and run but I'm trying to figure out the alway
// ------------------------------------------------------
// -- SMAA ----------------------------------------------
// ------------------------------------------------------
#define SMAA_PIXEL_SIZE float2(1.0/ viewport_width, 1.0/ viewport_height)
#define SMAA_HLSL_3 1
#define SMAA_PRESET_HIGH 1
#include "SMAA.h"
/**
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!
template <>
struct ObjectSpawner::EnemyTraits<Zombie01> { const int enemy_type = (int)ZOMBIE_01; };
@haxpor
haxpor / README.md
Last active December 16, 2015 00:08
TestFlight Wrapper for C++ coder See README.md

TestFlightWrapper

Created as a C++ wrapper for TestFlight SDK v.1.2.4 with the aim to clear cut using Objective-C from C++ code.
I tested with cocos2d-x v.2.0.3 (which is adhered to cocos2d v.2.0) on iOS platform.
The test includes uploading build to TestFlight and play-through testing functionality of TestFlight.

Testing

Tested

  • setDeviceIdentifier()
@haxpor
haxpor / CCMenu.cpp
Last active December 21, 2015 08:59
Added holding touch functionality to CCMenuItem, thus related to CCMenu. It can return time passed since the previous holding touch. Holding touch functionality can be turned on/off on the fly during run-time. The benefit is that we can use CCMenu with holding touch functionality without a need to implement on our own in external checking inside…
/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@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();
@haxpor
haxpor / gen-secret.txt
Created January 17, 2016 08:24
Randomly generate string text secret
ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
@haxpor
haxpor / Update-text-3-zombiehero.txt
Created January 24, 2016 13:38
Update text #3 of Zombie Hero : Revenge of Kiki on iOS platform
Big updates for you guys!
We have 2 new modes, full gamepad support, iCloud enabled, along with several improvement, and bug fixes.
** 2 New Modes **
- Zombie Apocalypse
Fight against huge amount of zombies in each different type. Try to get the highest score and share it on Facebook or Twitter. Show off your friends!
You have only one chance to revive for each gameplay.
- Challenge Mode
@haxpor
haxpor / instruction.txt
Created February 28, 2016 22:18
Instruction to install pecl on Mac OSX. Found here http://stackoverflow.com/a/34536398/571227.
The following instructions install PEAR and PECL on Mac OS X under /usr/local/. PECL is bundled with PEAR. So this is as simple as installing PEAR on Mac OS X.
PEAR is PHP’s Package Repository and makes it easy to download and install PHP tools like PHPUnit and XDebug. I specifically recommend these two for every PHP developer.
Download PEAR
curl -O http://pear.php.net/go-pear.phar
sudo php -d detect_unicode=0 go-pear.phar
Configure and Install PEAR
You should now be at a prompt to configure PEAR.
/start - Greeting with users, show them some basic info of what bot can do, and list of commands.
/stop - End the conversation, just say good bye, and start it over.
/help - Show very brief info of what bot can do, and list of commands.
/getname - Return name of the author, in this case "Wasin Thonkaew". Of course :)
/getnickname - Return nickname of the author.
/getsocial - Return the list of social channels that author has and users can check them out.
/getfreelancingrate - Return freelancing rate of the author.
/getcurrentlocation - Return the current location of the author.
/getproductsmade - Return the list of products that author has made.
/getlistofclients - Return the list of clients.