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 | |
require_once('test_jobs.php'); | |
if (php_sapi_name() === 'cli') { | |
$upload_options = getopt("",array( | |
'upload:', // --upload=5 | |
)); | |
} | |
else if (!empty($_GET['upload'])) { | |
$upload_options = $_GET; |
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 | |
// check required Redis module | |
if (!class_exists('Redis')) { | |
throw new Exception("Requires PHP Redis extension. Install via: sudo apt-get install php5-redis"); | |
} | |
class TestJobs { | |
private $redisInstance = null; | |
private $redisConfig = array(); |
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
#!/bin/bash | |
# Usage: ./export_db_table_schemas.sh {custom directory} | |
MYSQL_USER="{username}" | |
MYSQL_PWD="{password}" | |
MYSQL_DB="{database}" | |
[ "$1" != "" ] && SQL_DIR=$1 || SQL_DIR="schemas" | |
mkdir -p $SQL_DIR |
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
/* | |
Author: Josue Rodriguez <josue@josuerodriguez.com> -- MIT License -- (c) 2012 | |
Purpose: Filter an object list | |
Usage: | |
<input type="text" id="filter_list"> | |
<div id="my_list"> | |
<div data-id="{id}">{label}</div> | |
<div data-id="{id}">{label}</div> | |
<div class="hide" id="list_empty">Non Available</div> |
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(){ | |
$.fn.onEnterKey = function(opts,callback){ | |
var opt = typeof target==="object" && target || {}; | |
var target = opts.target || typeof opts===jQuery && opts || typeof opts==="string" && opts || null; | |
var callback = opt.callback || typeof opts==="function" && opts || typeof callback==="function" && callback || function(target){ | |
$(target).trigger("click"); | |
}; | |
return this.live("keypress.onEnterKey",function(e){ | |
if(e.keyCode==13) { | |
callback.call(this,target); |
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
// wait until first function executes true then run callback. | |
UI = ENV = {}; | |
ENV._ui_until = {}; | |
UI.until = function(before, after) { | |
var opt = typeof before == "object" && before || {}; | |
opt.before = opt.before || opt.check || before; | |
opt.after = opt.after || opt.callback || after; | |
var u = { | |
id: opt.id || +(new Date), |
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
// prerequisites: jQuery library. | |
getInputs = function(t,f){ | |
var opt = typeof t==="object" && t || {}; | |
var target = opt.target || (t===jQuery || typeof t==="string") && t; | |
var filter = opt.filter || f; | |
var A = { | |
serialized: {}, | |
fields: $("input,textarea,select", target || document) | |
}; |
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
/* | |
* Author: Josue Rodriguez <josue@josuerodriguez.com> | |
* Created: 2011-06-30 | |
* License: MIT | |
* Description: Collects OpenGraph tag data from markup into an object list. | |
*/ | |
var OpenGraph = function(opts){ | |
var opt = opts || {}; | |
var context = opt.DOM || typeof opts==="string" && opts || document; |
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
/* =========================================================================== | |
Copyright (c) 2011 - Josue Rodriguez <josue@josuerodriguez.com> | |
Permission is hereby granted, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, and/or distribute copies of the Software, | |
and to permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
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(){ | |
// jQuery - DummyImage | |
// Josue Rodriguez (c) 2010-12-30, MIT License | |
$.fn.dummyImage = (function(options) { | |
var opt = { | |
'class' : 'dummyImage', | |
'display' : 'inline-block', | |
'position' : 'relative', |