This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socket = new WebSocket('ws://127.0.0.1:8889'); | |
socket.onopen = function ( ) { | |
console.log('connection is opened'); | |
return; | |
}; | |
socket.onmessage = function ( msg ) { | |
console.log(msg.data); | |
return; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$name = $attribute['name']; | |
unset($attribute['name']); | |
$type = camel_case($attribute['type']); | |
unset($attribute['type']); | |
$index = null; | |
if (isset($attribute['index'])) { | |
$index = $attribute['index']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From: http://stackoverflow.com/questions/61552/are-there-legitimate-uses-for-javascripts-with-statement | |
for (var i=0; i<3; ++i) | |
{ | |
// object members introduced in this statement | |
// are scoped to the block following it. | |
with ({num: i}) | |
{ | |
setTimeout(function() { alert(num); }, 10); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"resources": { | |
"game" : [ | |
{ "id": "players", "url": "assets/tp/players.json" }, | |
{ "id": "level", "url": "assets/tilemaps/test.json", "type": "tilemap" } | |
], | |
}, | |
"scenes": { | |
"scene-1": { "url": "assets/scene-1.json" } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just instantiating is fine, the request gets executed normally | |
var req : MyRequest = MyRequest(...); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RPG Maker sprite-sheet extractor | |
require 'fileutils' | |
target_file = File.basename(ARGV[0], File.extname(ARGV[0])) | |
output_dir = "#{File.dirname(ARGV[0])}/#{target_file}" | |
FileUtils.mkdir_p(output_dir) | |
# extract each sprite | |
%x(convert #{ARGV[0]} -crop 24x32 #{output_dir}/sprite-%03d.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ 1:45:24] endel:~/Projects | |
$ curl -sSL https://raw.githubusercontent.com/doubleleft/hook/master/scripts/install.sh | bash | |
Cloning into 'hook'... | |
remote: Counting objects: 248, done. | |
remote: Compressing objects: 100% (219/219), done. | |
remote: Total 248 (delta 9), reused 120 (delta 6), pack-reused 0 | |
Receiving objects: 100% (248/248), 155.39 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (9/9), done. | |
Checking connectivity... done. | |
# check dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Magento | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* that is bundled with this package in the file LICENSE.txt. | |
* It is also available through the world-wide-web at this URL: | |
* http://opensource.org/licenses/osl-3.0.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.stonespells.core; | |
import javax.microedition.lcdui.Graphics; | |
import javax.microedition.lcdui.Image; | |
public class Font { | |
// additional space between characters | |
public int charS = 0; | |
// max clipping area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ar-extensions' | |
# ActiveRecord::Extensions fix for using ILIKE with PostgreSQL database | |
# | |
# Usage sample: | |
# User.find(:all, :conditions { :name_ilike => "%something%" }) | |
module ActiveRecord::Extensions | |
class ILike |
OlderNewer