Skip to content

Instantly share code, notes, and snippets.

@andycole
andycole / DW-Hacks.html
Created September 26, 2017 09:10
Code workarounds
<!-- Hide particular product in items to match on PDP -->
<!-- Inserted into Product description of master product -->
<script>
defer(function($){
function hideSuspenders() {
var _sspndr = $('a:contains("Sexy Lace Suspender Belt")').closest('li')
var _sspndr2 = $('a:contains("Standalone Suspender Belt")').closest('li')
if ($('.product-top-content .color-swatch.black.selected').length) {
_sspndr.hide()
_sspndr2.show()
@andycole
andycole / InterviewQuestions.md
Created January 19, 2016 10:33
Interview Questions

##JavaScript specific Questions

  • Which JavaScript libraries have you used?
  • How is JavaScript different from Java?
  • What are undefined and undeclared variables?
  • What is an expression?
  • What is a statement?
  • Give an example of a function declaration
  • Give an example of a function expression
  • Explain what the DOM is and some best practices for interacting with it.
@andycole
andycole / moly
Created February 13, 2015 14:34
moly
var textArray = [
'There is an acorn, and it is a golden acorn. We&#x27;re taking acorns to the next level.',
'I still have nightmares about holding German sausages over my head.',
'I want you to think of the sword as a conductor&#x27;s baton. As you&#x27;re fighting, we&#x27;ll be introducing different musical elements, the more successful you are. And we&#x27;ll be upping the tempo of the music, the more abilities that you unlock. So you not only get more of a score, you get a cooler soundtrack.',
'And if I really was a hero, and were in a world that was, you know, a world of heroes... I don&#x27;t think I would be like Robin Hood. I think I want to keep a bit of the money. I&#x27;d give SOME away, but I wouldn&#x27;t give it ALL away. I just think that&#x27;s crazy.',
'The British people hate successful people; that&#x27;s why our newspapers are so successful -- because we as a nation build people up, and as soon as they smell success we smash them down into the ground again!',
'I used to have this chat-up
@andycole
andycole / amd-module-template.js
Last active January 30, 2017 21:15
AMD Module Template
// MYMODULE CLASS DEFINITION
// ==========================
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(window.jQuery);
}
}(function ($) {
@andycole
andycole / amd-jquery-plugin-template.js
Last active August 29, 2015 14:13
AMD jQuery Plugin Template
// MYPLUGIN CLASS DEFINITION
// ==========================
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(window.jQuery);
}
}(function ($) {
@andycole
andycole / display.sh
Created May 7, 2014 16:10
~/.screenlayout/display.sh
#!/bin/sh
xrandr --output CRT1 --off --output DFP6 --mode 1280x1024 --pos 0x0 --rotate normal --output DFP7 --mode 1920x1080 --pos 1280x0 --rotate normal --output DFP4 --off --output DFP5 --off --output DFP2 --off --output DFP3 --off --output DFP1 --off
@andycole
andycole / Preferences.sublime-settings
Created May 7, 2014 15:43
Preferences.sublime-settings
{
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".tpl.php"
],
"font_size": 10,
@andycole
andycole / gist:0a11266e94145101b970
Created May 7, 2014 09:50
Vagrant Issues for Ubuntu/Debian

Vagrant Issues for Ubuntu/Debian

PROBLEM 1

user ➤ vagrant up
VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.
@andycole
andycole / gist:9b29cfbb6e7ae24e3728
Created May 2, 2014 08:32
Switch to desktop view of a responsive site - Edit viewport size
/*
* Class forceDesktopSite - Handles switching between desktop and responsive site for mobile user who want desktop experience.
*/
var forceDesktopSite = {
targetWidth: 1024,
viewport: $('meta[name="viewport"]'),
init: function() {