Skip to content

Instantly share code, notes, and snippets.

View npm test
> @architect/sandbox@1.13.0 test /home/ubuntu/src/architect-sandbox
> npm run lint && npm run test:integration && npm run coverage
> @architect/sandbox@1.13.0 lint /home/ubuntu/src/architect-sandbox
> eslint . --fix
> @architect/sandbox@1.13.0 test:integration /home/ubuntu/src/architect-sandbox
View watch
update src/http/get-get-normal/node_modules/@architect/shared/package-lock.json
update src/http/get-get-normal/node_modules/@architect/shared/package.json
update src/http/get-get-normal/node_modules/@architect/shared/cache
update src/http/get-get-normal/node_modules/@architect/shared/constants
update src/http/get-get-normal/node_modules/@architect/shared/datetime
update src/http/get-get-normal/node_modules/@architect/shared/utils
update src/http/get-get-normal/node_modules/@architect/shared/node_modules
update src/http/get-get-normal/node_modules/@architect/shared/sources
remove src/http/get-get-normal/node_modules/@architect/shared/shared
update src/http/get-get-normal/node_modules/@architect/shared/cache/_convert-timestamp.js
View missing-feature-id-field.txt
Andalusia, Spain
Aragon, Spain
Asturias, Spain
Balearic Islands, Spain
Canary Islands, Spain
Cantabria, Spain
Castile-La Mancha, Spain
Castile and León, Spain
Catalonia, Spain
Ceuta, Spain
View flamegraph.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
joliss / gist:bce6017904544a11da00d28abf4005a3
Last active Jun 20, 2017
for next time I need to understand how Monads, higher-kinded types, sorts, and dependent types fit together
View gist:bce6017904544a11da00d28abf4005a3
// let's turn Promise and List into Monads
Promise::bind (then but must get promise)
List::bind (flatmap)
Promise::pure = Promise.resolve
List::pure = [x]
// This works in JS:
map(f: Fn, m: Monad) {

How about having "parent objects" instead of "lifetimes"?

Language design question: I wonder if we can replace or supplant the notion of "lifetimes" in languages like Rust with a notion of "parent objects" (or "context objects").

In Rust (and most languages), iterators into vectors are (ptr, end) pairs. Having a notion of "parent" objects allows us to make them plain ptr values, and additionally allows for safely appending to vectors while iterating.

Some background first. In Rust, iterators into vectors (technically, into slices) are internally represented as (ptr, end) pairs. Thus if we create an iterator,

let mut i = vec.iter();
View benchmark.js
const N = 1000000;
// 130 ms
(function() {
let a = '';
for (let i = 0; i < N; i++) {
a += 'x';
View fso.js
// module: fso, for in-memory file system objects
// FSObject is the raw object that will be part of the
// internal Broccoli plugin API. Need better name?
// (Git terminology: File = blob, Directory = tree,
// FSObject = object.)
class FSObject { }
class File extends FSObject {
View gist:fe9ed40417e326a20338c23a1986730b

Broccoli 1.0: What's New?

  • API future-proofed to allow for changes without breaking backwards compatibility
  • Temporary files now live in system-wide tmp dir (/tmp)
  • broccoli-sane-watcher pulled into core, now used by default
View poll_watcher.js
var helpers = require('broccoli-kitchen-sink-helpers')
var RSVP = require('rsvp')
module.exports = PollWatcher
function PollWatcher(options) {
this.options = options || {}
if (this.options.interval == null) this.options.interval = 100
this.treeHash = null
You can’t perform that action at this time.