Skip to content

Instantly share code, notes, and snippets.

@sousk
sousk / snippet.rb
Created June 16, 2009 00:33
weby: make current directory accessible via HTTP
#!/usr/bin/env ruby
require 'webrick'
require 'optparse'
include WEBrick
OPTIONS = {
# :BindingAddress => '0.0.0.0',
:Port => 3000,
@sousk
sousk / gist:754067
Created December 24, 2010 09:41
fire event after images loaded
var
starter = $('#base img'),
th = starter.length,
cnt = 0;
starter.one("load",function(){
(++cnt >= th) && run();
})
.each(function(){
if(this.complete) starter.trigger("load");
@sousk
sousk / gist:762552
Created January 2, 2011 14:02
enable to launch stable/beta/dev chrome. source: http://d.hatena.ne.jp/os0x/20110101/1293831128
#!/usr/bin/env osascript
do shell script "/Applications/Chromes/dev/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --user-data-dir=/Users/$USER/Library/Application\\ Support/Google/ChromeDev > /dev/null 2>&1 &"
@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
@sousk
sousk / prove-runner (TM's command)
Created February 1, 2011 10:47
prove runner, TextMate's code snippet, make your test running on remote.
#!/usr/bin/env ruby
file = ENV['TM_FILEPATH']
if file =~ /\.t$/
local = ENV['LOCAL_PROJECT_ROOT']
remote = ENV['REMOTE_PROJECT_ROOT']
path = file.sub local, remote
else
local = ENV['TEST_LOCAL_DIR']
#!/usr/bin/env ruby
confbase = 'git-ssh-create'
init_command = 'git --bare init'
server = `git config --global #{confbase}.server`.chomp
if server.empty?
warn "Please set git config server."
warn " git config --global #{confbase}.server '[username@]yourserver.example.com'"
exit 1
@sousk
sousk / jquery_deferred_chains.js
Created March 17, 2011 10:06
combine multiple chains with jQuery.Deferred
$.when(
sushi_roll(),
dispatch()
).done(function() {
console.log('accepted:', arguments[0], arguments[1]);
});
var n = 0;
function dispatch() {
return $.Deferred(function(dispached) {
@azu
azu / jquery.disableSelection.js
Created December 9, 2011 08:10
要素を選択範囲にできないようにする
(function ($) {
$.fn.disableSelection = function () {
return this.each(function () {
$(this).attr('unselectable', 'on')
.css({'-moz-user-select':'none',
'-o-user-select':'none',
'-khtml-user-select':'none',
'-webkit-user-select':'none',
'-ms-user-select':'none',
'user-select':'none'})
@hirose31
hirose31 / jsx
Created June 12, 2012 08:53 — forked from ywatase/jsx
_jsx()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
JSX_OPTIONS='\
--add-search-path\
--executable\
--run\
use strict;
use warnings;
use Plack::Request;
use Plack::MIME;
use Plack::App::Directory;
use FindBin;
my $java_bin = `which java` =~ s/[\n\r]//gr
or die 'Install Java :(';