Skip to content

Instantly share code, notes, and snippets.

View wgx731's full-sized avatar

Eric Wang GaoXiang wgx731

View GitHub Profile
@wgx731
wgx731 / PagingControl.js
Created May 19, 2012 06:05 — forked from raulriera/PagingControl.js
Nice Paging control for scrollableViews for Titanium Appcelerator
// Forked from https://gist.github.com/2417902 to fix a small bug
// -----
function PagingControl(scrollableView){
var pages = [];
var page;
var numberOfPages = 0;
// Configuration
var pageColor = "#c99ed5";
var container = Titanium.UI.createView({
@raulriera
raulriera / PagingControl.js
Created April 19, 2012 02:13
Custom paging control for scrollableViews for Titanium Appcelerator
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
// Configuration
var pageColor = "#c99ed5";
PagingControl = function(scrollableView){
var container = Titanium.UI.createView({
height: 60
@sausheong
sausheong / unshredder.rb
Created November 15, 2011 05:50
For the Instagram Challenge - Unshredder
require 'rmagick'
include Magick
shredded = ImageList.new "TokyoPanoramaShredded.png" # the original source
ROWS = shredded.rows # number of lines of pixes
working = [] # a working array of images
def strip_width
32
end
@ngty
ngty / gist:1229514
Created September 20, 2011 16:04
Module#attr_accessor & friends
# Have u ever found urself doing this:
class Thing
def size=(size)
@size = size
end
def size
@size
end
end
@wgx731
wgx731 / todolist.py
Created August 19, 2011 03:54
A simple enhancement version of python bottle framework "Todolist" tutorial. (Change GET to POST)
import sqlite3
from bottle import route, run, debug, template, request, validate, send_file, error
# only needed when you run Bottle on mod_wsgi
from bottle import default_app
@route('/todo')
def todo_list():
conn = sqlite3.connect('todo.db')
c = conn.cursor()
@geeknam
geeknam / git_history.php
Created May 8, 2011 16:43
Parse git log with PHP to an array
<?php
// Author: Ngo Minh Nam
$dir = "/path/to/your/repo/";
$output = array();
chdir($dir);
exec("git log",$output);
$history = array();
foreach($output as $line){
if(strpos($line, 'commit')===0){
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh