Skip to content

Instantly share code, notes, and snippets.

Avatar

Ron Korving ronkorving

View GitHub Profile
@ronkorving
ronkorving / tabbar.js
Created Mar 22, 2016
A proof-of-concept for a tab-system
View tabbar.js
(function () {
// <minui-tabs>
// <minui-tabbar>
// <minui-tab name="tab1" active>Tab 1</minui-tab>
// <minui-tab name="tab2">Tab 2</minui-tab>
// </minui-tabbar>
// <minui-tabspace>Hello world</minui-tabspace>
// <minui-tabspace>Goodbye cruel world</minui-tabspace>
// </minui-tabs>
@ronkorving
ronkorving / GetSystemLanguage.mm
Created Jan 28, 2015
Extracting iOS system language for Unity in Assets/Plugins/iOS/GetSystemLanguage.mm
View GetSystemLanguage.mm
#include "UnityAppController.h"
/*
* This Plug in will set a "systemLanguage" string key in PlayerPrefs with the system language code.
*/
@interface GetSystemLanguage : UnityAppController
@end
@implementation GetSystemLanguage
@ronkorving
ronkorving / ios6-timers.js
Last active Mar 9, 2022
iOS6 webkit timer bug workaround
View ios6-timers.js
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is released in the public domain. Do with it what you want, without limitations. I do not promise
// that it works, or that I will provide support (don't sue me).
// Author: rkorving@wizcorp.jp
var timeouts = {};
@ronkorving
ronkorving / nodejs-cluster-http-proxy.js
Created Sep 29, 2011
Combining cluster and node-http-proxy for part master and part worker http responses
View nodejs-cluster-http-proxy.js
var cluster = require('cluster'),
http = require('http'),
httpProxy = require('http-proxy');
var httpPort = 4332;
var clusterSock = './cluster.sock';
var httpServer = http.createServer(function (req, res) {
res.end('Worker! ' + process.pid);