display:flex | inline-flexflex-direction:row | row-reverse | column | column-reverseflex-wrap:nowrap | wrap | wrap-reversejustify-content:flex-start | flex-end | center | space-between | space-aroundalign-items:flex-start | flex-end | center | baseline | stretchalign-content:flex-start | flex-end | center | space-between | space-around | stretch
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 toCodes = function(str) { | |
| var i, carr = []; | |
| for(i = 0; i < str.length; i++) { | |
| carr.push(str.charCodeAt(i)); | |
| } | |
| return carr; | |
| }; | |
| toCodes("hahah"); // outputs [104, 97, 104, 97, 104] | |
| toCodes("Hahah hah!"); // outputs [72, 97, 104, 97, 104, 32, 104, 97, 104, 33] |
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 toAsciiIndex = function(str) { | |
| var i, carr = [], curr; | |
| for(i = 0; i < str.length; i++) { | |
| curr = str.charCodeAt(i); | |
| carr.push([curr%32, Math.floor(curr/32)]); | |
| } | |
| return carr; | |
| }; | |
| toAsciiIndex("Hah"); // -> [[8,2],[1,3],[8,3]] |
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
| { | |
| "d": [ | |
| { | |
| "name": "Squishy", | |
| "url": "http://spoike.github.io/html5-game/" | |
| }, | |
| { | |
| "name": "Minesweeper", | |
| "url": "http://spoike.github.io/minesweeper/" | |
| }, |
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
| <snippet> | |
| <content><![CDATA[define([${1}], function(${2}) { | |
| ${0} | |
| });]]></content> | |
| <tabTrigger>def</tabTrigger> | |
| <scope>source.js</scope> | |
| <description>Adds an RequireJS/AMD define block</description> | |
| </snippet> |
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
| // Adds pluckRef method to lodash | |
| // Example: _.(array, 'key1.key2.key3'); | |
| // Goes through each object of the array and attempts to pluck objects that are | |
| // in the specified object chain path. It filters away undefined values. | |
| _.mixin({ | |
| 'pluckRef': function(arr, keyPathRef) { | |
| var i, j, keys, key, ref, output = []; | |
| keys = keyPathRef.split('.'); | |
| // for each object in the array |
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
| @mixin keyframesteps($name, $steps, $startx, $endx) { | |
| @keyframes #{$name} | |
| { | |
| @for $i from 0 through $steps { | |
| $diff: ($endx - $startx) / $steps; | |
| #{($i/$steps*100)}% { | |
| $x: ($i * $diff) + $startx; | |
| background-position: $x 0; | |
| } | |
| } |
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
| // Here is a quick tutorial on how to create a functor, an object that acts | |
| // both as function and an object of functions (e.g. much like jQuery's globally | |
| // available $ object) | |
| // This is a factory method that creates the functor for us: | |
| function createFunctor() { | |
| // Declared variables are scoped within the createFunctor function | |
| // so they are practically private: | |
| var name = 'World'; |
Note that the assert object is not chainable. Link to assert docs.
-
assert(expression, message) -
assert.fail(actual, expected, [message], [operator]) -
assert.ok(object, [message])