Skip to content

Instantly share code, notes, and snippets.

View tomhalley's full-sized avatar

Tom Halley tomhalley

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tomhalley on github.
  • I am tomhalley (https://keybase.io/tomhalley) on keybase.
  • I have a public key ASA8p29YKfzoNRS3dkscNW6jbKR8-PKGpUr0mHkMDOZdtQo

To claim this, I am signing this object:

@tomhalley
tomhalley / gist:4f6310465e2b055bdc33
Created March 30, 2015 14:59
jQuery Deferred Image Preloader
var images = [
"pins/bluePin.png",
"pins/greenPin.png",
"pins/orangePin.png",
"pins/pinkPin.png",
"pins/purplePin.png",
"pins/yellowPin.png"
];
var preloadImages = function() {
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.110.50"
config.vm.provision :shell, path: ".vagrant/scripts/main.sh"
config.vm.provision "shell", inline: "service apache2 restart"
config.vm.synced_folder "/var/www/", "/home/tom/Projects/easyproperty"
@tomhalley
tomhalley / gist:726abdc7425c51ced112
Created March 30, 2015 14:55
PHP Apache Config
<VirtualHost *:80>
ServerName 192.168.110.50
DocumentRoot /var/www/public
<Directory /var/www/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
@tomhalley
tomhalley / gist:72b52d6ae73d9155a282
Last active August 29, 2015 14:18
jQuery Sequential Deferred
var persistUploads = function () {
var deferred = $.Deferred(),
persistQueue = [];
for (var type in Behaviour.Uploads.files) {
Behaviour.Uploads.files[type].sort(function(a,b) { return a.order - b.order; });
var image;
for (var a = 0; a < Behaviour.Uploads.files[type].length; a++) {