Skip to content

Instantly share code, notes, and snippets.

Avatar
Coffee.

Aubrey Taylor aubricus

Coffee.
View GitHub Profile
@aubricus
aubricus / create-new-file.ahk
Created Aug 16, 2011
AutoHotkey script to create a new file.
View create-new-file.ahk
; 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 Oct 1, 2015
Lazy Image Loader: Quick draft of a lazy image loader using jQuery.
View a-lazy-image-loader.js
/**
* @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 Aug 3, 2012 — forked from dinopetrone/gist:3252273
fizbuzz on crack
View gist:3252373
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 Dec 12, 2015
Windows, Vagrant ssh snippet
View vagrant-ssh.bat
:: 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 Feb 14, 2013
print message utility function for fabric tasks
View tasks.py
from utils import print_message
@task
def foo():
print_message('foo executed', 'green')
@aubricus
aubricus / core.test.js
Created Feb 16, 2013 — forked from drewwells/core.test.js
QUnit with Requirejs integration.
View core.test.js
//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 Mar 4, 2020 — forked from yuvadm/fabfile.py
Using Fabric to connect to the remote server via an ssh config.
View __init__.py
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 Jul 15, 2013
Check for scrollable element using jQuery.
View scrollable.js
/**
* 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 Dec 20, 2015
Zend routes vary in appearance
View RouteObjectInsanity.md

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.
View gist:6144061
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