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
{ | |
"lambda": { | |
"envVars": [], | |
"deploy": false, | |
"package": { | |
"optimize": { | |
"builder": "browserify", | |
"minify": true, | |
"ignore": [], | |
"exclude": [ |
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
export function get(url, callback) { | |
return function handleGet(next) { | |
const request = require('request'); | |
request(url, function handleRequest(error, response, body) { | |
if (error) { |
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 regex(p, s) { | |
var pPointer = 0; | |
var pLength = p.length; | |
var pChar = ''; | |
var sPointer = 0; | |
var sLength = s.length; | |
var sChar = ''; | |
var wChar = ''; |
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
@import '_common' | |
/** | |
* Clock animation | |
*/ | |
@keyframes alarm | |
from | |
transform rotate(-10deg) | |
to |
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
/** | |
* Base inheritable/mixable object with `create` and `mixin` functionality. | |
* @type {Object} | |
*/ | |
var Base = { | |
/** | |
* Create a new instance of the object and mixin additional behaviors. |
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 fizzbuzz(n, s, i) { | |
s = { | |
0: 'FizzBuzz', | |
3: 'Fizz', | |
5: 'Buzz', | |
6: 'Fizz', | |
9: 'Fizz', | |
10: 'Buzz', | |
12: 'Fizz' | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CardFactory</title> | |
</head> | |
<body> | |
<script src="http://code.jquery.com/jquery.js"></script> | |
<script> | |
;(function(window, document, $) { |
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
/** | |
* Adds two numbers. | |
* @param {Number} a First addend. | |
* @param {Number} b Second addend. | |
* @return {Number} The sum of the addends. | |
* @when a is 1 and b is 2 | |
* @expect 3 | |
*/ | |
function addition(a, b) { | |
return a + 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
function findLongSelectors(n) { | |
var sheets = document.styleSheets; | |
var splitRule = /\s*,\s*/; | |
var splitWhitespace = /\s+/; | |
var longRules = []; | |
[].forEach.call(document.styleSheets, function(styleSheet) { | |
if (!styleSheet.cssRules) return; | |
[].forEach.call(styleSheet.cssRules, function(cssRule) { |
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
// https://twitter.com/angustweets/status/467117418511212544 | |
var a = [1,2,3,4,5]; | |
a.map(Date.call, Number); // [0, 1, 2, 3, 4] | |
var b = []; b.length = 5; | |
b.map(Date.call, Number); // [undefined × 5] | |
var c = [,,,,,] | |
c.map(Date.call, Number); // [undefined × 5] |