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
| <!-- | |
| dribbble rebound of MVben's design http://dribbble.com/shots/1145537-Plug-In1 | |
| --> | |
| <div class="main"> | |
| <div class="nav"> | |
| <ul> | |
| <li class="al">Alarms</li> | |
| <li class="sw">Stopwatch</li> |
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
| /* These styles correspond to card.rb from github.com/CharlesAMoss/ruby-tools */ | |
| *, *:before, *:after { | |
| box-sizing: border-box; | |
| } | |
| body { | |
| background: #f9f9f9; | |
| color: #000; |
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 x = "great sadness"; | |
| var great_magic = function ( str ) { | |
| var result = str.replace(new RegExp(("\\b" + "sadness" + "\\b"), 'g'), "happiness"); | |
| return result; | |
| }; | |
| console.log(great_magic(x)); // logs "great happiness" |
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 myArray = [1,2,3,4,5,6,7,8,9,10,15]; | |
| let zed = z => (z % 3 === 0 && z % 5 === 0) ? "fizzbuzz" : | |
| (z % 3 === 0 ) ? "fizz" : | |
| (z % 5 === 0 ) ? "buzz" : | |
| z; | |
| console.log(myArray.map(zed)); // [1,2,"fizz",4,"buzz","fizz",7,8,"fizz","buzz","fizzbuzz"] | |
| // transpiled with babeljs ver 5.x |
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
| 'use strict'; | |
| let getDeck = () => { | |
| let deck = []; | |
| const numVal = _.range(2, 11).map(String); | |
| const faceVal = ['J', 'Q', 'K', 'A']; | |
| const value = numVal.concat(faceVal); | |
| const suits = ['♠', '♥', '♣', '♦']; | |
| for (var suit of suits) { | |
| const cards = value.map(val => val + suit); | |
| deck.push(cards); |
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 isPrime = N => { | |
| return (N > 1) && Array.apply(0, Array(1 + ~~Math.sqrt(N))). | |
| every((x, y) => (y < 2) || (N % y !== 0)); | |
| } | |
| const primeTime = N => ([...Array(N).keys()].filter(isPrime)); | |
| primeTime(10); | |
| // output [2,3,5,7] |
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
| <form> | |
| <div> | |
| <input type="checkbox" value="this one"> | |
| <label for="this one">This</label> | |
| </div> | |
| <div> | |
| <input type="checkbox" value="that one"> | |
| <label for="that one">That</label> | |
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
| body { | |
| background :#fffeb3; | |
| /* display: flex; | |
| justify-content: center; | |
| align-items: center;*/ | |
| } | |
| img { | |
| width: 100%; | |
| max-width: 500px; |
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
| this.size = 31 * (alpha.indexOf(arr.map( y => y.split('id="').pop().split('.').shift()) | |
| .sort((a,b) => a.length - b.length || a.localeCompare(b)).pop()) + 1) |
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 entry = document.getElementById("entry"); | |
| // every journey begins with one step | |
| const svg = document.createElement("svg"); | |
| svg.setAttribute("width", "100%"); | |
| svg.setAttribute("height", "100%"); | |
| const g = document.createElement("g"); |
OlderNewer