Skip to content

Instantly share code, notes, and snippets.

IMPORTANT! Wikified version of this page may be found here. Feel free to edit. :)

Note that since it's kind of PITA to merge changes from other gists it's recommended that you do your changes directly to the wiki!

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
Aves Commercial? Obsolete. Company bought by Zynga.
@finscn
finscn / gist:2517406
Created April 28, 2012 09:16 — forked from haqu/gist:1016550
decoding PNG images from IPA package
mkdir _png
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush -d _png -revert-iphone-optimizations -q *.png
@finscn
finscn / splice vs non-splice
Created January 14, 2013 10:29
array splice vs non-splice
function createObjectArray(length){
var arr=[];
for (var i=0;i<length;i++){
var obj={
id : "id_"+i,
foo : "bar",
value : i
};
arr.push(obj);
function randomPick(list){
return list[ Math.random()*list.length|0 ];
}
function test(listSize,testCount){
listSize = listSize||20;
testCount = testCount||100;
var list=[ ];
for (var i=0;i<20;i++){
function mazed(dom) {
if (!dom){
dom=document.createElement("div");
var css=[
'font-family:courier;\
font-size:20px;\
letter-spacing:-5px;\
line-height: 14px;\
padding: 4px;\
#include "dynamic_battlefog.h"
#include <cmath>
#include <set>
#include <map>
#include <assert.h>
#include <algorithm>
using std::max;
using std::min;
CDynamicBattleFog::CDynamicBattleFog()
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <net/if.h>
void ip_for_interface(const char *interface_name, char *ip, const int length) {
*ip = NULL;
@finscn
finscn / checkSequence
Last active August 29, 2015 13:57
检测 两组任意(不限个数 不限花色) 的扑克牌, 混到一起后能否构成任意长度(大于1 小于15)的顺子.A代表1或14,小王代表1--5,大王代表1--14
/*
检测 两组任意(不限个数 不限花色) 的扑克牌, 混到一起后能否构成任意长度(大于1 小于15)的顺子.
A可表示1或14,小王可表示1--5,大王可表示1--14
说明:
1 我微博里说 小王代表 1到9有误, 我这边实际遇到的场景是 小王代表 1--5 (当然 这个无所谓)
2 牌是可以有重复的 : 例如 可以 4个小王 9个大王 等等, 可以理解为是从无数副扑克牌当中随意抽取出两组
3 组成的顺子 可以不是5张 , 其实严格说 就是 等差为1的等差数列
4 能且只能组成一组顺子, 组成顺子后, 牌没有剩余
@finscn
finscn / dns-setter.sh
Created May 18, 2015 03:23
dns setter
#!/bin/bash
# please run this shell with "sudo ...."
echo "Current DNS on Wi-Fi:"
networksetup -getdnsservers Wi-Fi
echo "======================"
echo "0 . Default (Empty)"
echo "1 . google DNS"
echo "2 . ali DNS"
@finscn
finscn / dns-setter.sh
Last active July 31, 2019 18:54
dns setter
#!/bin/bash
# Please run this shell with "sudo ..."
SERVICE=Wi-Fi
# You could change the service. List all network services via:
# networksetup -listallnetworkservices
echo ""
echo "Current DNS on ${SERVICE}:"