Skip to content

Instantly share code, notes, and snippets.

James Brooks jbrooksuk

Block or report user

Report or block jbrooksuk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View slow.php
<?php
private function loadQuotes() {
$this->comment('Loading quotes...');
$hFile = fopen($this->store . 'quotes.csv', 'r');
$progress = $this->getHelperSet()->get('progress');
$progress->setFormat($progress::FORMAT_VERBOSE_NOMAX);
$progress->start($this->getOutput());
View serializeObject.js
$.fn.serializeObject = function() {
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
View index.js
var https = require('https');
var Notification = require('node-notifier');
var CronJob = require('cron').CronJob;
var storesUrl = 'https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/stores.json';
var stockUrl = 'https://reserve.cdn-apple.com/GB/en_GB/reserve/iPhone/availability.json';
var stockLastUpdated;
var stores;
View sym-default.sublime-theme
{
"class": "icon_folder_dup",
"layer0.texture": "Theme - Default/icons/folder_dup.png",
"layer0.opacity": 1.0,
"content_margin": [8, 8]
}
View gist:de76b30d4c786d7f672d
This file has been truncated, but you can view the full file.
4d390885d709f97385ec581cf17c05852a3850d1 commit 400 267 12
486f8def9e531b3461b38292acc39e15db2dc077 commit 257 174 279
a7b22305c49c038b4ea791069d9dddbdd1f4842c commit 447 299 453
ebe2e27f9ddcb1d7cc7f94c4cf62219bb6dd51ac commit 442 298 752
1bf05c78baa46c8551e6899514f10916365db585 commit 545 355 1050
8f3f3792b039f2521af5389e5f5495bba1e790fe commit 301 206 1405
6a7a950042c0d4d3aed457671228898e782a5c6f commit 236 161 1611
7a7c98a05cbf6ea85fb9cd16eef0f74f41cfd091 commit 378 250 1772
a977d063a0335723d1a649bc0097bfade20f45ad commit 439 280 2022
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@jbrooksuk
jbrooksuk / jQuery Create Plugin
Created Apr 11, 2011
Creates DOM elements taking an element and a set of attribute properties
View jQuery Create Plugin
(function($) {
$.fn.create = function(el, attr) {
return jQuery(document.createElement(el)).attr(attr).prependTo(this);
}
})(jQuery);
@jbrooksuk
jbrooksuk / Raw HTML from element
Created Apr 12, 2011
Returns the raw HTML code for a supplied element.
View Raw HTML from element
(function($) {
$.fn.nodeHTML = function() {
return jQuery('<div>').append(jQuery(this).clone()).remove().contents().html();
};
})(jQuery);
@jbrooksuk
jbrooksuk / Sublime Text 2 PHP Build
Created Apr 12, 2011
Build file for PHP under Sublime Text Alpha 2
View Sublime Text 2 PHP Build
{
"cmd": ["php", "-l", "$file"],
"selector": "source.php",
"file_regex": "^Parse error: .* in (.*?) on line ([0-9]*)"
}
@jbrooksuk
jbrooksuk / gist:1004154
Created Jun 2, 2011
Table rows/cols selection
View gist:1004154
<!DOCTYPE html>
<html>
<head>
<title>jQuery RTE Dynamic Table Insertion Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<style type="text/css">
.aBlock {
width: 20px;
height: 20px;
background-color: #A9EDF5;
You can’t perform that action at this time.