+-------------+
| |
| |
| |
| |
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
<script> | |
const html = String.raw; | |
const spinner = "߷"; | |
function createDetails(n) { | |
if (n <= 0) { | |
return "<div class='end'>End</div>"; | |
} | |
return html`<details> | |
<summary>${spinner}</summary> |
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
<div class="controls"> | |
<a href="#user-content-s1">yeah</a> | |
<a href="#user-content-s2">unyeah</a> | |
<a href="#user-content-s3">eggbug</a> | |
</div> | |
<div class="screen-container"> | |
<div class="screen" id="s1">:yeah:</div> | |
<div class="screen" id="s2">:unyeah:</div> | |
<div class="screen" id="s3">:eggbug:</div> |
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 chanceToWin() { | |
return Math.random() < 0.5; | |
} | |
function howManyMatchesToGoFlawless() { | |
let matches = 0; | |
let wins = 0; | |
while (wins < 7) { | |
if (chanceToWin()) { | |
wins++; |
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 main() { | |
console.log("hello world"); | |
} | |
main(); |
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
#!/usr/bin/env bash | |
set -eu | |
main() { | |
Object.new | | |
Object.set name "$(echo Brian Mock | String.new)" | | |
Object.get name | |
Array.new | | |
Array.push 1 | |
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
node_modules/ | |
.cache/ | |
dist/ | |
*.log |
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
r => { | |
var ElseIf = ( | |
P.seqObj( | |
keyword("elseif"), | |
r.Expr.trim(_).as("condition"), | |
keyword("then"), | |
r.Block.trim(_).as("block"), | |
).node("ElseIf") | |
); | |
return ( |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
checkboxes: Ember.computed(function() { | |
return Array.from({length: 4}, (x, i) => { | |
return { | |
index: i, | |
checked: i >= 2 | |
}; |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
checkboxes: Ember.computed(function() { | |
return Array.from({length: 4}, (x, i) => Ember.Object.create({checked: i >= 2})); | |
}), | |
checkboxesAsJson: Ember.computed('checkboxes.@each.checked', function() { | |
return JSON.stringify(this.get('checkboxes'), null, 2); | |
}) |
NewerOlder