Skip to content

Instantly share code, notes, and snippets.

View jaredmcateer's full-sized avatar
🏠
Working from home (I'm always working from home)

Jared McAteer jaredmcateer

🏠
Working from home (I'm always working from home)
View GitHub Profile
var TitleTest = TestCase('TitleTest');
TitleTest.prototype.defaultTitle = 'title';
TitleTest.prototype.defaultCount = '0';
TitleTest.prototype.setUp = function() {
var titleObj;
this.div = new Element('div');
$$('body').first().insert(this.div);
this.div.insert('<div id="title"><h1><span id="titleCaption">' + this.defaultTitle + '</span><span id="titleCount">' + this.defaultCount + '</span></h1></div>');
getWindowScroll: function() {
var T, L, W, H;
var w = window;
with (w.document) {
if (w.document.documentElement && documentElement.scrollTop) {
T = documentElement.scrollTop;
L = documentElement.scrollLeft;
} else if (w.document.body) {
T = body.scrollTop;
@jaredmcateer
jaredmcateer / gist:2386718
Created April 14, 2012 18:26
Firefox User Style for MemoryExpress.com
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("memoryexpress.com") {
.PLV_Image,
.PLV_Details,
.PLV_Stock,
.PLV_SaleStar,
.PLV_SaleSpacer {
display:none !important;
}
@jaredmcateer
jaredmcateer / gist:2386724
Created April 14, 2012 18:26
Google Chrome user style for MemoryExpress.com
.PLV_Image,
.PLV_Details,
.PLV_Stock,
.PLV_SaleStar,
.PLV_SaleSpacer {
display:none;
}
.PLV_Brand,
.PLV_Title {
@jaredmcateer
jaredmcateer / gist:2783646
Created May 24, 2012 19:15
Cookie manager bookmarklet (requires prototype)
javascript:(function(a){function c(a){var b=window.getComputedStyle(a.target,null);a.dataTransfer.setData("text/plain",parseInt(b.getPropertyValue("left"),10)-a.clientX+","+(parseInt(b.getPropertyValue("top"),10)-a.clientY))}function d(a){return a.preventDefault(),!1}function e(a){var b=a.dataTransfer.getData("text/plain").split(","),c=document.getElementById("cmgr_dragMe");return c.style.left=a.clientX+parseInt(b[0],10)+"px",c.style.top=a.clientY+parseInt(b[1],10)+"px",a.preventDefault(),!1}function f(){var a,b,c,d;return a='<h1>Cookie Manager [<span id="cmgr_close">X</span>]</h1>',b='<fieldset><legend>Add</legend><label>Key:<br><input type="text" id="cmgr_addKey" /></label><br><label>Value:<br><input type="text" id="cmgr_addValue" /></label><br><input type="submit" id="cmgr_addCookie" value="Add"></fieldset>',c='<fieldset><legend>Delete</legend><label>Key:<br><input type="text" id="cmgr_delKey" /></label><br><input type="submit" id="cmgr_delCookie" value="Delete" /></fieldset>',d='<fieldset><legend>Get</leg
@jaredmcateer
jaredmcateer / gist:2846398
Created May 31, 2012 21:22
Bookmarklet: Responsive Design Tester
javascript:document.write('<!DOCTYPE html><html><head><meta charset="utf-8"><title>Responsive Design Testing</title><style>body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }.wrapper { width: 6000px; }.frame { float: left; }h2 { margin: 0 0 5px 0; }iframe { margin: 0 20px 20px 0; border: 1px solid #666; }</style></head><body><div class="wrapper"><div class="frame"><h2>240<span> x 320</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="240" height="320"></iframe></div><div class="frame"><h2>320<span> x 480</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="320" height="480"></iframe></div><div class="frame"><h2>480<span> x 640</span> <small>(small tablet)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="480" height="640"></iframe></div><div class="frame"><h2>768<span> x 1024</span> <sma
@jaredmcateer
jaredmcateer / gist:2853224
Created June 1, 2012 16:07
Rally Userstyle Chrome
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td{
font-family: "Droid Sans", "Ubuntu", sans-serif;
}
#notesEditorContainer {
height: 830px;
}
.nav-tab, .nav-tab-active, .tab {
border-top-left-radius: 4px;
@jaredmcateer
jaredmcateer / gist:2853227
Created June 1, 2012 16:07
Rally Userstyle Mozilla
@-moz-document domain("rally1.rallydev.com") {
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td{
font-family: "Droid Sans", "Ubuntu", sans-serif;
}
#notesEditorContainer {
height: 830px;
}
.nav-tab, .nav-tab-active, .tab {
@jaredmcateer
jaredmcateer / gist:3137486
Created July 18, 2012 17:05
Bitbucket error
Uncaught TypeError: Object function (z,L){var C;z||(z={});if(C=this.defaults){if(d.isFunction(C))C=C.call(this);z=d.extend({},C,z)}this.attributes=
{};this._escapedAttributes={};this.cid=d.uniqueId("c");this.set(z,{silent:true});this._changed=false;this._previousAttributes=d.clone(this.attributes);if(L&&L.collection)this.collection=L.collection;this.initialize(z,L)} has no method '_bindRoutes'
@jaredmcateer
jaredmcateer / gist:4999410
Created February 20, 2013 20:40
Bookmarklet that keeps your user list sorted when it gets updated instead of putting new users at the bottom of the list like a chump
javascript:(function(){chat.update_roster=function(room_jid){if(room_jid&&room_jid!=app.current_jid){return;}var roster=(room_jid?app.room_rosters[room_jid].sort(function(a,b){if(a.name<b.name){return-1;}else if(a.name>b.name){return 1;}return 0;}):app.roster);if(!roster){return;}$('#roster div.member').remove();for(var i=0;i<roster.length;i++){var status_info=this.get_status_info(roster[i]);var member=roster[i];$('#roster div.list').append('<div class="'+roster[i].role+'"><div jid="'+roster[i].jid+'" class="member '+status_info.show+'">'+member.name+'<span class="idle">'+status_info.idle+'</span><span class="status">'+status_info.status+'</span></div></div>');}$('#roster div.member').dblclick($.proxy(this,'handle_roster_dblclick')).mouseover(function(event){$(this).css('background-color','#F0F0F0');}).mouseout(function(event){$(this).css('background-color','#FFFFFF');}).tooltip({bodyHandler:chat.generate_roster_tooltip});if(config.mobile){$('#roster div.member').click($.proxy(this,'handle_roster_dblclick'));