Skip to content

Instantly share code, notes, and snippets.

View oojacoboo's full-sized avatar

Jacob Thomason oojacoboo

View GitHub Profile
@oojacoboo
oojacoboo / gist:3890446
Created October 15, 2012 01:50
Remember Windows
property numChromeWindows : 0
property ChromePos : {}
property ChromeSize : {}
property PHPStormPos : 0
property PHPStormSize : 0
property MailPos : 0
property MailSize : 0
property TextualPos : 0
property TextualSize : 0
property AdiumContactsPos : 0
this.getJSONAndParse = function() {
var _self = this;
log("made it");
$.getJSON(baseUrl + "/reports/xxx", function(data) {
log("made it 2");
log(data);
_self.reset();
_self.unitGroupId = $("#unit-group").val();
_self.loadData(data);
_self.parseJson();
/**
* Checks the internal class of an Object to determine the "type"
* A class can be one of the following values: "Arguments", "Array", "Boolean", "Date", "Error",
* "Function", "JSON", "Math", "Number", "Object", "RegExp", "String"
*
* @param type
* @param obj
* @return {Boolean}
*/
function is(type, obj) {
$con = Propel::getConnection();
$query = 'SELECT *
FROM `work_order` a
LEFT JOIN (
SELECT *, COUNT(unit_id)
AS numberSubmissions
FROM `work_order`
GROUP BY group_id
) AS b
ON a.id = b.id
/**
* @param string $name
* @param string $value
* @throws Exception
* @return null
*/
public function setSetting($name, $value) {
if($value === true || $value === "true")
$value = 1;
if($value === false || $value === "false")
location (/(mypost)[/](.*)|/(myrent)[/](.*)|/(myplace)[/](.*)|/(control)[/](.*)) {
default_type text/html;
set $app $1;
#rewrite (.*)\.php $1 permanent;
try_files $app.php/$2 $app/$2 =404;
}
public function filterByRelation($relation, $relationId) {
$relationPeer = ucwords($relation) . 'Peer';
return $this->useDocumentRelationQuery()
->useDefaultDocumentRelationQuery()
->filterByType($relation)
->endUse()
->addJoin(DocumentRelationPeer::RELATION_ID, $relationPeer::ID, Criteria::LEFT_JOIN)
->filterByRelationId($relationId)
->endUse();
$.fn.setupFilterInput = function() {
log("setupFilterInput");
return this.find("[placeholder]")
.focus(function(event) {
if(this.value == $(this).attr("placeholder"))
this.value = "";
}).blur(function(event) {
if(this.value == "")
this.value = $(this).attr("placeholder");
$.fn.setupFilterInput = function() {
log("setupFilterInput");
var $searchX = $(this).parent.find("x-icon");
this.focus(function(event) {
if(this.value == $(this).attr("placeholder"))
this.value = "";
}).blur(function(event) {
if(this.value == "")
this.value = $(this).attr("placeholder");
@oojacoboo
oojacoboo / DocumentsPager.js
Created December 16, 2012 05:01
DocumentsPager
function DocumentsPager(containerEl) {
this.containerEl = containerEl;
this.jsonResults = null;
this.jsonResultsReady = false;
this.template = "";
this.searchQuery = "";
this.loadData = function(jsonResults) {
this.jsonResults = jsonResults;