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
<div class="video-wrapper"> | |
<iframe width="560" height="315" src="https://www.youtube.com/embed/jEnd8JIMii4?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe> | |
</div> |
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
/** | |
* @example | |
* | |
* import {getLocation} from './services/getLocation'; | |
* getLocation().then(res => { | |
* console.log(res); | |
* }); | |
* | |
* @returns {Promise<any>} | |
*/ |
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
// Prefix mixins | |
// ------------- | |
// Example use: | |
// @include transition(transform 500ms, box-shadow 500ms); | |
@mixin transition ($values...) { | |
-webkit-transition: $values; | |
-ms-transition: $values; | |
transition: $values; | |
} |
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
// True or False | |
const trueOrFalse = () => | |
Boolean(Math.random() > .5) | |
// Random Float | |
const randomFloat = (min, max) => | |
Math.random() * (max - min) + min | |
// Random Number | |
const randomNumber = (min, max) => |
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
/** | |
* Pass an Array of image urls and it will run `callback` once they are cached. | |
* | |
* @example | |
cacheImagesThenCallback([image.jpg, picture.png], function() { | |
... | |
}); | |
* @alias CORE.cacheImagesThenCallback | |
* @constructor | |
* @param imageSrcArray {array} Array of image urls. |
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
/** | |
* Using apply and built-in functions | |
* | |
* Clever usage of apply allows you to use built-ins functions for some tasks that otherwise probably would have been written by looping over the array values. As an example here we are going to use Math.max/Math.min to find out the maximum/minimum value in an array. | |
*/ | |
// min/max number in an array | |
var numbers = [5, 6, 2, 3, 7]; | |
// using Math.min/Math.max apply |
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
/** | |
* project.exampleModule | |
* @namespace project.exampleModule | |
*/ | |
(function (window, project, undefined) { | |
/** | |
* @constructor | |
* @public | |
* @memberof project.exampleModule |
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 http = require("http"); | |
http.get(weatherApi, function(res) { | |
var body = ''; | |
// get chunks of data and add it to body | |
res.on('data', function(chunk){ | |
body += chunk; | |
}); |
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
$.validator.addMethod("passwordCheck", function (value, element) { | |
return this.optional(element) || /((?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%-_=+<>]).{8,30})/g.test(value); | |
}, "Field must contain only letters, numbers, or dashes."); |
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
$.validator.addMethod("passwordCheck", function (value, element) { | |
return this.optional(element) || /((?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%-_=+<>]).{8,30})/g.test(value); | |
}, "Field must contain only letters, numbers, or dashes."); |