This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global => { | |
'use strict' | |
// if analytics is already defined, we probably don't need this. | |
if (global.analytics) { return } | |
class Analytics { | |
/** | |
* Creates a new instance of the analytics service. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Order of operations: | |
user clicks on button within a slideshow | |
button emits a 'click' event | |
slideshow catches button click event | |
slideshow handles the specified action (change the slide to the right) | |
slideshow emits a 'slide_changed' event | |
click gallery, acting as a controller/higher-level wrapper for the slideshow in this case catches the slide changed event | |
click gallery tells the advertisement to update | |
advertisement runs an update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Concerns: | |
* How to render inline images, links, smart content(eg. `[twitter: @jacopotarantino]`), etc... | |
* Do those sub-components actually need to be subcomponents or can we just `.innerHTML`? | |
* What about updating article content? | |
* Do articles ever really have events on/in them? | |
*/ | |
import { analytics } from 'services' | |
import { UIComponent } from 'ui-component' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('ProductSwatch Widget', function() { | |
var fixture_markup = '<div>' // replace me with a reference to the above. | |
var product_swatch = null | |
beforeEach(function () { | |
$(document.body).appendChild(fixture_markup) | |
product_swatch = new window.clique.ProductSwatch() | |
}) | |
afterEach(function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.jQuery(function () { | |
'use strict'; | |
var $parent = $('.gallery-grid-fullwidth'); | |
$('> *', $parent) | |
.sort(function () { | |
return ( Math.round( Math.random() ) - 0.5 ) | |
}) | |
.appendTo($parent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WARNING: seriously please be careful with this if you don't know what you're doing. | |
# Reverting, resetting, and force-pushing are all actions that can make you lose work. | |
# If you lose that work you will be unhappy and your coworkers will hate you. | |
# You've been warned. | |
# okay, so if you’re on the branch that has the work | |
# (let’s assume master) the flow looks like this: | |
git checkout master | |
# you should already be here but all the same... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @function resize_video | |
* @param {string} selector - the selector for the video iframe to resize. | |
* @returns {jQuery object} - the video node | |
* @requires jQuery | |
* @description this function takes a selector for an iframe | |
* and resizes it to have a height that's appropriate for how the video is currently scaled. | |
* This is primarily useful in situations in which you've embedded a video from Youtube | |
* or Vimeo but it's getting black bars around it on some mobile devices because the video | |
* is being scaled down but it still has a fixed height on the iframe. This script assumes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Demonstration of a stored ajax request in ES6. | |
*/ | |
class ReadingList { | |
// Initialize the instance with an empty variable just so we can null-check it. | |
constructor () { | |
this.article_list = null | |
} | |
// Use a getter for a slightly more concise syntax. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
/** | |
* JSDoc dictionary that enables `@sideffects` as a tag. | |
*/ | |
exports.defineTags = function (dictionary) { | |
dictionary.defineTag('sideeffects', { | |
onTagged: function (doclet, tag) { | |
doclet.has_sideffects = tag.value || true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first you'll want to use the dig command. this will give you the IP address of the server you've contacted: | |
dig jack.ofspades.com | |
# this should output somewhere around 20 lines depending on your hosting. the important part is in the "answer section": | |
# > ;; ANSWER SECTION: | |
# > jack.ofspades.com. 60 IN A 52.84.14.75 | |
# then run the whois command on the IP address in question: | |
whois 52.84.14.75 |