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 / android-links.md
Last active July 22, 2016 18:03
Interesting links and technical stuff in day-to-day development
@haxpor
haxpor / engine_rulelist.cs
Created July 27, 2016 14:26
Demonstrate how to know reward to get if users execute such an action from engine rule
// call engine rule to get a list of rule info
// to get to know reward to get from executing such action on Engine api
EngineApi.RuleInfoList(Playbasis.Instance, "comment", "jontestuser",
delegate(List<RuleInfoVariant2> result, HttpError error) {
if (error == null) {
if (result != null) {
// loop through all rule
foreach (RuleInfoVariant2 ruleInfo in result)
{
@haxpor
haxpor / gist:9ec0a7ba145d717be041cfc9dd4dde63
Created August 20, 2016 09:14
Code to manually create UIWindow, and UIViewController with customized UIView without involving with Interface Builder
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
CGRect screenRect = [UIScreen mainScreen].bounds;
self.window = [[UIWindow alloc] initWithFrame:screenRect];
GLView *glView = [[GLView alloc] initWithFrame:screenRect];
UIViewController *rootVc = [[UIViewController alloc] init];
[rootVc.view addSubview:glView];
@haxpor
haxpor / README.md
Created August 20, 2016 19:20
itunes's receipt validator by

In App Purchase Receipt Validator - PHP

Host this on any box which is running PHP and has direct outbound web access and it will be able to validate iOS IAP receipts for you (Sandbox or Production environment configurable).

Feel free to use this code in anything you make, with the standard disclaimer that if it doesn't work / blows up the universe, you're on your own.

Alternatively, the latest version is hosted at: http://www.chrismaddern.com/validate-itunes-receipt/

This points to production.

@haxpor
haxpor / steps.txt
Last active March 15, 2017 12:14
Remove ignored files that were already committed. Thanks to https://www.git-tower.com/learn/git/faq/ignore-tracked-files-in-git.
$ git rm -r --cached .
$ git add .
$ git commit -m "Clean up ignored files"
@haxpor
haxpor / skeleton.cpp
Last active July 2, 2020 03:47
Skeleton code for sdl
#include <SDL2/SDL.h>
#include <iostream>
// screen dimension constants
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
SDL_Window* gWindow = NULL;
SDL_Renderer* gRenderer = NULL;
@haxpor
haxpor / skeleton.cpp
Last active March 11, 2023 12:13
OpenGL with SDL2. Compile it with "gcc -Wall -o skeleton skeleton.cpp -F /Library/Frameworks -lstdc++ -I /Library/Frameworks/SDL2.framework/Headers -framework SDL2 -framework OpenGL" on Mac OSX.
/**
* Simple SDL2 program using OpenGL as rendering pipeline.
*/
#include <iostream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include <OpenGL/GLU.h>
#define SCREEN_WIDTH 640
@haxpor
haxpor / pbxproj-diff.txt
Last active October 26, 2016 13:02
Diff between 2 projects generated with ionic (rc-1) cli. The diff file is generated via diff comparing failed-project to success-project.
8d7
<
15a15,21
> 7AA484D8671B4F4FAD2BEFAA /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 7F92630E181141039AA090FB /* CDVLogger.m */; };
> C09B4047D1DF43B88E365E5C /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = E64DC7260FBA48608D8FD2FE /* CDVDevice.m */; };
> E3ADD04642B74603A7EE2AB0 /* NativeStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = AB9742C2704E405482736609 /* NativeStorage.m */; };
> FBD7F35D70D548328D3BC273 /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 2991DB23B4884D6792BDC50F /* CDVSplashScreen.m */; };
> 4B80DF741B8148C1AC120FEC /* CDVViewController+SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 5276D82FEB1341EB88B0BD64 /* CDVViewController+SplashScreen.m */; };
> BC93ABE0255D4DB28AECFD03 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 14593FC73F464F68B07F8DC4 /* CDVStatusBar.m */; };
> 8F517527A4C446EB947AE5B2 /* IonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = C406194DB33C4C679
@haxpor
haxpor / app.js
Last active November 9, 2016 17:34
Deeplink integrated with Branch.io with ionic 1 (sidemenu template)
// Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules
// 'starter' is the name of this angular module example (also set in a <body> attribute in index.html)
// the 2nd parameter is an array of 'requires'
// 'starter.controllers' is found in controllers.js
angular.module('starter', ['ionic', 'starter.controllers', 'starter.openUrl'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
@haxpor
haxpor / Default.handlebars
Created November 23, 2016 06:44
Default template of Macdown (Version 0.6.4 (786) to include support for mermaid, and fix final css styling.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
{{{ titleTag }}}
{{#each styleTags }}