Skip to content

Instantly share code, notes, and snippets.

@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 / moly
Created February 13, 2015 14:34
moly
var textArray = [
'There is an acorn, and it is a golden acorn. We'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's baton. As you're fighting, we'll be introducing different musical elements, the more successful you are. And we'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't think I would be like Robin Hood. I think I want to keep a bit of the money. I'd give SOME away, but I wouldn't give it ALL away. I just think that's crazy.',
'The British people hate successful people; that'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 / 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 / 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()