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
<? | |
class a{ | |
public $something; | |
function output(){ | |
echo("A happens!<br>"); | |
} | |
} | |
class b{ |
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
document.registerCallback = function(callbackEvent, callbackFunction){ | |
if(typeof document.callbacks == 'undefined')document.callbacks = {}; | |
if(typeof document.callbacks[callbackEvent]=='undefined')document.callbacks[callbackEvent]=[]; | |
document.callbacks[callbackEvent].push(callbackFunction); | |
return callbackFunction; | |
}; | |
document.runCallbacks = function(callbackEvent,arguments){ | |
for(var name in document.callbacks[callbackEvent]){ | |
document.callbacks[callbackEvent][name].apply(null,arguments); |
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
Function.prototype.name = function(){ | |
return this.toString().match(/function ([^\(]+)/)[1]; | |
} |
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
assign = function(par,child,func){ | |
var theOldOne = par[child]; | |
par[child] = function(){ | |
theOldOne.call(this,arguments); | |
func.call(this,arguments); | |
} | |
} | |
assign(window.console,'log',function(args){alert(args);}); |
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
String.prototype.sanitize = function(){ | |
return this.replace(/[^a-zA-Z]/g,'_').replace(/_{2,}/g,'_').toLowerCase().replace(/^_+|_+$/g,''); | |
} |
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
if(typeof Object.prototype.clone !== 'function'){ | |
Object.prototype.clone = function(){ | |
var F= function(){}; | |
F.prototype = this; | |
return new F(); | |
}; | |
} |
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 | |
function _f($callback,$arguments) { | |
if(!is_callable($callback))throw new Exception('Function '.$callback.' does not exist.'); | |
$params = new ReflectionFunction($callback); | |
$params = $params->getParameters(); | |
$argNames = array(); foreach ($params as $param){ | |
$argNames[] = $param->name; |
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
document.body.innerHTML = ((function(d,o){ | |
o.y=new Date(d.album_release_date).getFullYear(); | |
o.r=['<h1>'+ o.a([d.artist,o.y,d.current.title].join(' - '),d.url)+'</h1>']; | |
(o.u = d.artFullsizeUrl) && o.r.push('<img src="'+ o.u+'"/>'); | |
d.trackinfo.forEach(function(t){ | |
for(o.i in t.file){} | |
o.r.push(o.a((""+t.track_num).replace(/^(\d{1})$/g,'0$1') + ' - '+ t.title+'.mp3',t.file[o.i])); | |
}); | |
return o.r.join("<br/>\n"); |
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 | |
// Loading plish from hard drive and getting plish dimentions | |
$plish = imagecreatefrompng('plish.png'); | |
list($x,$y) = array(imagesx($plish),imagesy($plish)); | |
// --- Creating black image with dots | |
// Creating new image (black by default) with dimentions of a plish | |
$dots = imagecreatetruecolor($x,$y); |
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
function cookiesafe_session_start(){ | |
$sn = session_name(); | |
if (isset($_COOKIE[$sn])) { | |
$sessid = $_COOKIE[$sn]; | |
} else if (isset($_GET[$sn])) { | |
$sessid = $_GET[$sn]; | |
} else { | |
session_start(); | |
return false; | |
} |
OlderNewer