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
/** | |
* JavaScript Class Definition | |
* | |
* Author: Roger "SparK" Rodrigues da Cruz | |
* Licence: Free, no credits, no references, just use it if you feel like. | |
*/ | |
;MyClass = (function(){ | |
var C = function(){ return constructor.apply(this,arguments); } | |
var p = C.prototype; | |
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
/** | |
* Placeholder - jQuery Plugin | |
* Emulates the html5 placeholder effect on older browsers | |
* | |
* Copyright (c) 2014 Roger 'SparK' Rodrigues da Cruz | |
* | |
* Version: 0.3 (14/02/2014) | |
* Requires: jQuery | |
* | |
* Dual licensed under GPL and MIT: |
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
Function.prototype.defer = function(thisObj, parameters){ | |
if (typeof parameters == "undefined") | |
parameters = []; | |
if (typeof window.deferredActionsList === "undefined") | |
window.deferredActionsList = []; | |
if (typeof window.__deferredActionsRunner === "undefined") | |
window.__deferredActionsRunner = setTimeout(function(){ | |
for(var key in window.deferredActionsList){ |
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
;(function(){ | |
// Cookie management | |
window.Furnace = { | |
cookie: function(name) { | |
function splitCookie() { | |
if (document.cookie.length == 0) { | |
return null; | |
} | |
var start = document.cookie.indexOf(name + "="); |
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
export const waitFor = function(search :function, callback :function, interval = 500) :void { | |
const checkLoop = setInterval(function () { | |
let element = search(); | |
if (typeof element === 'undefined' || element === null) { | |
return; | |
} | |
clearInterval(checkLoop); | |
callback(element); |
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
<?php | |
trait Fillable { | |
public function __construct($attributes) { | |
$this->fill($attributes); | |
} | |
public function fill($attributes) : void { | |
foreach((array)$attributes as $key => $value) { | |
if (!property_exists($this, $key)) | |
continue; |
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
<?php | |
use Symfony\Component\Config\FileLocator; | |
use Phinx\Config\Config; | |
use Phinx\Db\Adapter\AdapterFactory; | |
class Database extends \LessQL\Database { | |
const PHINX_FILE = 'phinx.yml'; | |
public function __construct($env = null) { | |
$config = $this->readPhinxConfig($env); |
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
<?php | |
trait Requestable { | |
private function getRequest($url) { | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($curl, CURLOPT_HEADER, false); | |
try { | |
return [curl_exec($curl), curl_errno($curl)]; |
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
const Bingo = (function(){ | |
const pool = []; | |
for(let i=0; i<79; i++) { | |
pool.push(i+1); | |
} | |
function next() { | |
const index = Math.round(Math.random() * (pool.length - 1)); | |
return pool.splice(index, 1)[0]; | |
} |
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
<?php | |
namespace Test; | |
trait Trespasser | |
{ | |
protected function forceCall($subject, $methodName, ...$parameters) | |
{ | |
$reflection = new \ReflectionMethod($subject, $methodName); | |
$reflection->setAccessible(true); | |
return $reflection->invokeArgs($subject, $parameters); |
OlderNewer