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 p = new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve() | |
| }, 5000) | |
| }) | |
| let interval | |
| p.then(() => { | |
| clearInterval(interval) |
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
| function fetch (uri) { | |
| return new Promise(function (resolve, reject) { | |
| $.ajax(uri).then(function (data, textStatus, jqXHR) { | |
| resolve([data, textStatus, jqXHR]) | |
| }).fail(function (jqXHR, textStatus, errorThrown) { | |
| reject([jqXHR, textStatus, errorThrown]) | |
| }) | |
| }) | |
| } |
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 yo = require('yo-yo') | |
| var root = render(5) | |
| document.body.appendChild(root) | |
| document.body.style.backgroundColor = 'green' | |
| function roundBox (x, y, w, h, r) { | |
| return `M${x},${y + r} a${r},${r} 0 0,1 ${r},-${r} l${w - r * 2},0 a${r},${r} 0 0,1 ${r},${r} l0,${h - r * 2} a${r},${r} 0 0,1 -${r},${r} l-${Math.max(0, w - r * 2)},0 a${r},${r} 0 0,1 -${r},-${r} l0,-${Math.max(0, h - r * 2)} Z` | |
| } |
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 yo = require('yo-yo') | |
| var csjs = require('csjs') | |
| var style = csjs` | |
| .enter { | |
| animation-duration: 3s; | |
| animation-name: slidein; | |
| } | |
| .exit { | |
| animation-duration: 3s; |
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 yo = require('yo-yo') | |
| var csjs = require('csjs') | |
| var style = csjs` | |
| .enter { | |
| animation-duration: 3s; | |
| animation-name: slidein; | |
| } | |
| .exit { | |
| animation-duration: 3s; |
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 yo = require('yo-yo') | |
| // Adapted from http://codepen.io/tvweinstock/details/MamJjQ/ | |
| function checkerboard (data) { | |
| data = data || {} | |
| var size = data.size || 10 | |
| var color = data.color || 'rgba(159, 188, 191, 0.4)' | |
| var id = 'checkerboard' + Date.now() | |
| var fill = 'url(#' + id + ')' |
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 yo = require('yo-yo') | |
| var dance = [ | |
| '<("<)', | |
| '<( \' \' )>', | |
| '(> ")>', | |
| '<( \' \' )>' | |
| ] | |
| var i = 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
| var yo = require('yo-yo') | |
| var orig = yo`<button onclick=${function () { | |
| console.log('orig clicked!') | |
| }}>click</button>` | |
| setTimeout(function () { | |
| var newbutton = yo`<button onclick=${function () { | |
| console.log('new clicked!') | |
| }}>click new</button>` |
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
| Ember.I18n.translations = { | |
| "app.done": "Done", | |
| "app.continue": "Continue", | |
| "app.ok": "OK", | |
| "app.okay": "Okay", | |
| "app.save": "Save", | |
| "app.send": "Send", | |
| "app.delete": "Delete", | |
| "app.cancel": "Cancel", | |
| "app.back": "Back", |
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
| <html> | |
| <head> | |
| <title></title> | |
| </head> | |
| <body> | |
| Hi | |
| <script> | |
| var link = document.createElement('link') | |
| link.setAttribute('rel', 'stylesheet') | |
| link.setAttribute('href', require('path').join(__dirname, 'css', 'app.css')) |
NewerOlder