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
<script> | |
// When a tab is clicked, animate scroll to the top of the tabs element | |
$('.w-tab-link').on('click', function (event) { | |
var clickedLink = $(event.currentTarget); | |
var tabsElement = clickedLink.closest('.w-tabs'); | |
var rootElement = $('html, body'); | |
var newTop = tabsElement.offset().top; | |
if (rootElement.scrollTop() !== newTop) { | |
rootElement.stop().animate({scrollTop: newTop}, 500, 'swing'); | |
} |
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
const timeout = ms => new Promise(res => setTimeout(res, ms)); |
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
<!-- Localizer Integration Code w/ Webflow Editor Compatibility --> | |
<script> | |
var Webflow = Webflow || []; | |
Webflow.push(function() { | |
if (!window.WebflowEditor) { | |
$.ajax({ type: 'GET', url: '//secure.localizer.co/Replacer/?siteId=000000000', dataType: 'script', cache: true }); | |
} | |
}); | |
</script> |
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
<script> | |
// Initialize fullpage plugin on document ready | |
Webflow.push(function() { | |
$('#fullpage').fullpage(); | |
}); | |
// Define module for Editor compatibility | |
Webflow.define('fullpage-destroy', function() { | |
return { | |
destroy: function() { | |
$.fn.fullpage.destroy('all'); |
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
./node_modules/.bin/babel test.js # SyntaxError: test.js: Line 2: "FOO" is read-only | |
./node_modules/.bin/eslint test.js # Nothing |
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
var Promise = require('promise'); | |
var promise = new Promise(function (resolve, reject) { | |
resolve(); | |
}).done(function() { | |
console.log('done!'); | |
}); |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var pluralize = require('pluralize'); | |
document.body.innerHTML = pluralize.singular('Pasties'); |
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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Rebuild to run it on the right | |
var Hogan = require('hogan.js'); | |
var data = { | |
screenName: "dhg", | |
nested: {} | |
}; |
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
// validation mixin | |
var validation = { | |
getDefaultProps: function () { | |
return { | |
validate: [] | |
} | |
} | |
, hasErrors: function () { | |
var errors = [] |
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
var mash = require('mash-js'); | |
var withSword = mash(function () { | |
this.slash = function (dmg) { | |
console.log('Sword slash for ' + dmg + ' damage!'); | |
}; | |
}); | |
var withMagic = mash(function () { | |
this.fireball = function (dmg) { |
NewerOlder