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
module.exports = { createCachedPromise, cacheifyAll }; | |
// TODO: Add Map/WeakMap cache isolation for arguments passed into cacheifyAll's methods | |
/** | |
* Extends all functions on an Object or Class with 'Cached' suffixed methods. | |
* Methods must return promises when called! Won't break existing functions/usage. | |
* | |
* ----- | |
* |
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
#!/bin/sh | |
echo "Starting XCode Command Line Tools Setup... Continue using the GUI prompt..." | |
sleep 4s | |
xcode-select --install | |
echo "DONE: Installing XCode Command Line Tools\!" | |
# install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
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
// Challenge: Refactor the `render()` method with declare all variables at top | |
render() { | |
return ( | |
<li> | |
<div className="profile-card"> | |
<header className="profile-header" onClick={this.toggleClass}> | |
<img src={this.props.profile.image} alt={this.props.profile.name} /> | |
<h2>{this.props.profile.name}</h2> | |
</header> |
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
@namespace | |
class Math { | |
static abs(x: Number): Number; // Types optional; provide cast on input and assertion on ouptut | |
@nonwritable | |
static LOG10E: Number; | |
// ... | |
} |
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
// Standard: | |
function fn(x) { | |
return function(y){ | |
return function(z){ | |
return x * y / 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
// This is the API for constructing a Glimmer.js application with | |
// precompiled binary bytecode templates and using an async renderer | |
// (via requestAnimationFrame, requestIdleCallback, etc). | |
import Application, { DOMBuilder, AsyncRenderer, BytecodeLoader } from '@glimmer/application'; | |
import data from './__compiled__/data'; | |
let bytecode = fetch('./__compiled__/templates.gbx') | |
.then(req => req.arrayBuffer()); |
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
// TODO: INSTALL PRE-REQS: `npm install express cors body-parser morgan monk` | |
const http = require('http') | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const morgan = require('morgan') | |
const cors = require('cors') | |
const app = module.exports = express() | |
const server = http.createServer(app) | |
const port = parseInt(process.env.PORT || 3000) |
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
dialog { | |
position: fixed; | |
top: 50%; | |
left: 50%; | |
right: auto; | |
padding: 30px; | |
transform: perspective(500px) translate(-50%, -50%); | |
background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
border: none; | |
border-radius: 3px; |