Skip to content

Instantly share code, notes, and snippets.

View aubricus's full-sized avatar
Coffee.

Aubrey Taylor aubricus

Coffee.
View GitHub Profile
@aubricus
aubricus / create-new-file.ahk
Created August 16, 2011 00:00
AutoHotkey script to create a new file.
; create new file
; installation:
; 1. you must be running autohotkey: http://www.autohotkey.com
; 2. double click on script to run
; [pro-tip] add this script to your startup folder to run when windows start
; [pro-top] you can add this script to another .ahk script file.
; hotkey is set to control + alt + n
; more on hotkeys: http://www.autohotkey.com/docs/Hotkeys.htm
@aubricus
aubricus / a-lazy-image-loader.js
Last active October 1, 2015 20:37
Lazy Image Loader: Quick draft of a lazy image loader using jQuery.
/**
* @name lazyImageLoader
* @description A quick implementation of a lazy loading technique for images.
* @returns object {"load": load} (see below)
*
* @param $imageList jquery selector List of images
* @param options object Configuration options
* - "queue_size" the size of the "queue" you'd like to load when loader.load() is called
* - "data_attr" the name of the data-attribute on your image tag; ex: "<img data-src="http://placehold.it/10x10 />"
*/
@aubricus
aubricus / gist:3252373
Created August 3, 2012 22:57 — forked from dinopetrone/gist:3252273
fizbuzz on crack
var fb = {
fbArr:['','','Fizz','','Buzz','Fizz','','','Fizz','Buzz','','Fizz','','','FizzBuzz'],
next:function(){
var index = this.count();
var total = this.total();
console.log(total + ':' + this.fbArr[index])
},
count:function(){
if(typeof(arguments.callee.index) == 'undefined')arguments.callee.index =-1;
arguments.callee.index ++;
@aubricus
aubricus / vagrant-ssh.bat
Last active December 12, 2015 03:58
Windows, Vagrant ssh snippet
:: Windows / Vagrant ssh snippet
:: Gotcha: Calling "ssh" from the windows CMD.exe requires Cygwin installed and
:: added to the PATH. This allows me to use the ssh port, but does not
:: require that I run this batch through Cygwin.
:: Notes:
:: The Vagrant convenience "vagrant ssh" doesn't work on windows.
:: One is left to manually ssh into the virtual box, which can be cumbersome.
@aubricus
aubricus / tasks.py
Created February 14, 2013 00:35
print message utility function for fabric tasks
from utils import print_message
@task
def foo():
print_message('foo executed', 'green')
@aubricus
aubricus / core.test.js
Created February 16, 2013 05:29 — forked from drewwells/core.test.js
QUnit with Requirejs integration.
//Wait for relevant code bits to load before starting any tests
define(['core.js'], function( core ) {
module("Core Tests");
test("Test core methods", function(){
expect(2);
equals( 1, 1, "A trivial test");
ok( true, "Another trivial test");
});
@aubricus
aubricus / __init__.py
Last active November 27, 2022 01:19 — forked from yuvadm/fabfile.py
Using Fabric to connect to the remote server via an ssh config.
from fabric.api import env
env.use_ssh_config = True
env.forward_agent = True
env.roledefs = {
# key # hostname from config
'foo': ['foo.production'],
}
@aubricus
aubricus / scrollable.js
Created July 15, 2013 19:29
Check for scrollable element using jQuery.
/**
* Test to get correct scrollable element
* @return {string}
* @see http://www.zachstronaut.com/posts/2009/01/18/jquery-smooth-scroll-bugs.html (updated to use $.scrollTop())
* @requires jquery 1.7+
*/
getScrollable = function(){
var result = 'html, body',
initScrollTop;
@aubricus
aubricus / RouteObjectInsanity.md
Last active December 20, 2015 09:39
Zend routes vary in appearance

Zend Route Object Insanity

Zend route objects seem to vary in appearance given certain conditions.

Notes:

  • Route object obtained from ControllerInstance->params()->fromRoute()
  • Other Zend objects returning either a route or an array with a route seem to suffer the same problem.
  • This could be a route configuration problem, but logging here for reference.
  • Below I've cataloged what I've found so far.
@aubricus
aubricus / gist:6144061
Created August 2, 2013 22:44
IE VM Automation
https://github.com/xdissent/ievms
Quick Installation:
1. Install VirtualBox (make sure command line utilities are selected and installed).
2. Download and unpack ievms:
- Install IE versions 6, 7, 8, 9 and 10.
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash