Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 CSSURL = '//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css' | |
const style = document.createElement('link'); | |
style.setAttribute('href', CSSURL); | |
style.setAttribute('rel', 'stylesheet'); | |
document.body.appendChild(style); |
This file contains 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
As a user | |
I want to Sign-Up | |
So that can use the App to it's fullest | |
Given I have an email address | |
And agree to the PP and TnC | |
When the form is valid and submitted | |
Then an email is sent | |
And the activation code is presented | |
Then the link is clicked |
This file contains 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
{ | |
"1000":{ | |
"code":"1000", | |
"name":"Green beige", | |
"rgb":"205-186-136", | |
"hex":"#CDBA88" | |
}, | |
"1001":{ | |
"code":"1001", | |
"name":"Beige", |
This file contains 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
// convert 0..255 R,G,B values to binary string | |
RGBToBin = function(r,g,b){ | |
var bin = r << 16 | g << 8 | b; | |
return (function(h){ | |
return new Array(25-h.length).join("0")+h | |
})(bin.toString(2)) | |
} | |
// convert 0..255 R,G,B values to a hexidecimal color string | |
RGBToHex = function(r,g,b){ |
This file contains 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
// The expensive animation is causing performance issues. Write the function 'yourFunction' that reduces calls to the animation. | |
function scrollHandler() { | |
var items = document.querySelectorAll('.list-item'); | |
var i = 0; | |
var len = items.length; | |
for(; i < len; i++) { | |
// perform expensive animation | |
} |
This file contains 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
/* | |
JavaScript Test | |
--------------- | |
A small script to open a popup when clicking a link. | |
Once you click on the button, clinking on it again will close the popup. | |
*/ | |
/* Task One - Improve this code |
This file contains 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
{ | |
"NORMAL": 0, | |
"ADD": 1, | |
"MULTIPLY": 2, | |
"SCREEN": 3, | |
"OVERLAY": 4, | |
"DARKEN": 5, | |
"LIGHTEN": 6, | |
"COLOR_DODGE": 7, | |
"COLOR_BURN": 8, |
This file contains 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
// Returns a function, that, when invoked, will only be triggered at most once | |
// during a given window of time. Normally, the throttled function will run | |
// as much as it can, without ever going more than once per `wait` duration; | |
// but if you'd like to disable the execution on the leading edge, pass | |
// `{leading: false}`. To disable execution on the trailing edge, ditto. | |
// Replaced namespace and _.now function to function scope | |
// https://github.com/jashkenas/underscore/blob/master/underscore.js#L779 | |
function throttle(func, wait, options) { |
This file contains 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 colorText(str) { | |
var phase = 0; | |
var outputStr = new Array(); | |
var args = new Array(); | |
var center = 128; | |
var width = 127; | |
var frequency = Math.PI*2/str.length; | |
var red, green, blue, i; | |
function componentToHex(c) { |
NewerOlder