Skip to content

Instantly share code, notes, and snippets.

on("add:character", function(obj) {
// If there aren't any ability objects to grab, then we're probably in the middle of a sandbox spin-up
if (findObjs({ _type: "ability"}).length === 0)
return;
var abil = findObjs({ _type: "ability", _characterid: obj.id});
if (abil.length === 0) // Only create the abilities if the character doesn't have any
{
createObj("ability", {
name: "Init",
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@mmattax
mmattax / Model.php
Created February 15, 2013 20:32
PDO based port of PEAR's DB_DataObject
<?php
namespace Framework;
use \PDO;
use \Exception;
abstract class Model {
private static $_host;
private static $_username;
private static $_password;
private static $_database;
@kares
kares / jquery.parseparams.js
Created May 5, 2011 11:28
jQuery.parseParams - parse query string paramaters into an object
/**
* $.parseParams - parse query string paramaters into an object.
*/
(function($) {
var re = /([^&=]+)=?([^&]*)/g;
var decodeRE = /\+/g; // Regex for replacing addition symbol with a space
var decode = function (str) {return decodeURIComponent( str.replace(decodeRE, " ") );};
$.parseParams = function(query) {
var params = {}, e;
while ( e = re.exec(query) ) {