-
minpubsub.php
-
Fixed issues with unsubscribe
-
PHP doesn't support
||
for variables, used inlineif
statement. -
Don't trust
$sub
to change self::$cache * Changed $callback to $call on local variable * Since we would do the check for callback to handle or handle[1], put as variable and check once. -
index.php
This file contains hidden or 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 Color = { | |
initialize: function(R, G, B, A){ | |
function verify(i) { | |
return (!is_int(i) || i < 0 || i > 255) ? 255 : i; | |
} | |
this.R = verify(R); | |
this.G = verify(G); | |
this.B = verify(B); | |
this.A = verify(A); |
This file contains hidden or 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
/** | |
* Revised three.js example. | |
* | |
* @author Nijikokun (@nijikokun) | |
* @original-author Paul Lewis (@aerotwist) | |
* | |
* @changelog | |
* 0.3 Fixed Commenting to be more descriptive. | |
* 0.2 Fixed JavaScript Coding style | |
* 0.1 Initial Creation |
This file contains hidden or 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
// Copyright AOL <http://aol.nexua.org> 2011 | |
// Author: Nijikokun | |
if (!String.prototype['%']) { | |
String.prototype['%'] = function() { | |
function get_type(variable) { | |
return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); | |
} | |
function str_repeat(pattern, count) { | |
if (count < 1) return ''; |
This file contains hidden or 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
// t (in CoffeeScript) | |
// | |
// Description: Quick Templating, optional customizing open/closing tags | |
// | |
// Author: Nijikokun <[email protected]> | |
// | |
// Usage: | |
// | |
// t('Hello {name}!', { name: 'World' }); | |
// |
This file contains hidden or 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
// Math.RGB() | |
// Actual Hex to RGB values, Invalid hex returns 0,0,0 or black. | |
// | |
// By Nijikokun | |
// | |
// Usage: | |
// 8 bit | |
// Math.RGB(0xFF) | |
// | |
// 12 bit |
This file contains hidden or 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
// Without the use of yield or enumerable definitions javascript makes enumerating over objects | |
// very difficult and verbose. | |
// Goes in Rectangle.js of my Geometry.js class | |
this.trace = function(f) { | |
if(this.width() > 1 && this.height() > 1) { | |
// top | |
(Rectangle.row( | |
this.topLeft(), this.width() - 1 | |
)).enumerate(f); |
This file contains hidden or 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 user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: false | |
); |
This file contains hidden or 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
@charset "UTF-8"; | |
/*! | |
Code written by Sam Collins (@smcllns) of www.eventasaur.us | |
You are free to use this work commercially | |
You are free to extend this work without permissions from the author (just do so tastefully eh?) | |
Enjoy | |
*/ | |
/* Reference icons from font-files */ |