Skip to content

Instantly share code, notes, and snippets.

View theroux's full-sized avatar

Andrew Theroux theroux

  • Washington, D.C.
View GitHub Profile
@theroux
theroux / throttle.js
Created July 17, 2013 15:21
Simple throttling function w/ jQuery
var scrollTimeout;
var throttle = 50;
var scrollMessage = function (message) {
console.log(message);
};
$(window).on('scroll', function () {
if (!scrollTimeout) {
scrollTimeout = setTimeout(function () {
// ==UserScript==
// @name One Creative
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Intelligently auto-shows/hides search box and filters
// @author Andrew Theroux
// @match http://onecreative.aol.com/
// @grant none
// ==/UserScript==
/* jshint -W097 */
body.ads .GETVLJGBCOB, body.ads .GETVLJGBGOB.GETVLJGBFP.GETVLJGBDOB, body.ads .GETVLJGBDOB {
display: block !important;
}
body.templates .GETVLJGBCOB, body.templates .GETVLJGBGOB.GETVLJGBFP.GETVLJGBDOB, body.templates .GETVLJGBDOB {
display: block !important;
}
body.campaigns .GETVLJGBL3B {
display: block !important;
.GETVLJGBHKB > tbody > tr > td:first-child {
transform: translateX(-100px);
}
.GETVLJGBCQ {
width: 140px;
}
.GETVLJGBBC {
width: auto;
}
.GETVLJGBBC div.buttonText {
$(window).load(function() {
var $fadedElems = $('body').find('.faded');
$fadedElems.removeClass('faded');
});
$(function() {
var $container = $('.img-container'),
$childElement = $('.img-container img'),
imgArray = [],
currentImg = 0;
@theroux
theroux / Boot GetJS
Last active December 20, 2015 12:39
Two ways of doing this.
OPTION A *** preferred
In module, have this:
<script type="text/javascript">
Boot.getJS({
src: 'http://se.loc:8888/js/somejsfile.js',
defer: 'ready'
});
@theroux
theroux / .gitignore
Created July 25, 2013 01:58
default .gitignore
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*~
# OS or Editor folders
.DS_Store
.cache
@theroux
theroux / collection.js
Last active December 19, 2015 21:29
jQuery plugin: collection method
(function ($) {
// Collection method.
$.fn.awesome = function () {
return this.each(function (i) {
// Do something awesome to each selected element.
$(this).html('awesome' + i);
});
};
};
@theroux
theroux / namespace.js
Last active August 29, 2015 14:13
Easy app namespace pattern reminder
var arcturus = {
//Private Properties
var prop = true;
//Public Property
arcturus.property = "some string";
//Public Method
arcturus.pubfunc = function() {
¯\_(ツ)_/¯
ಠ_ಠ
{◕ ◡ ◕}
(•_•)
( •_•)>⌐■-■
(⌐■_■)