This pattern is heavily inspired by golang concurrency patterns
- each component runs within an individual coroutine
- components communicate via channels
- runloops are blocked until message, but the main loop remains free
/** @jsx element */
05-10 15:52:00 DEBUG metabase.query-processor :: | |
QUERY: 😎 | |
{:database 2, :type "query", :query {:source_table 5, :aggregation ["count"], :breakout [["fk->" 47 216]], :filter []}, :constraints {:max-results 10000, :max-results-bare-rows 2000}} | |
05-10 15:52:00 DEBUG metabase.query-processor :: | |
PREPROCESSED/EXPANDED: 😻 | |
{:database {:name "doh", :details "😋 ", :id 2, :engine :bigquery}, | |
:type "query", | |
:query | |
{:source-table {:name "bookings", :id 5}, |
(ns inventory.core | |
(:gen-class) | |
(:require [datomic.api :as d])) | |
(def uri "datomic:mem://test") | |
(def schema [{:db/id #db/id[:db.part/db] | |
:db/ident :stock/in-stock | |
:db/valueType :db.type/bigint | |
:db/cardinality :db.cardinality/one |
(ns demo.core | |
(:require [datascript.core :as d])) | |
(enable-console-print!) | |
(def conn (d/create-conn {:parent {:db/valueType :db.type/ref}})) | |
(d/transact! conn [[:db/add -1 :name "Foo"] | |
[:db/add -2 :name "Bar"] | |
[:db/add -3 :name "Baz"] |
{ | |
"experiement-namespace": "B", | |
"another-namespace": "A" | |
} |
The MIT License (MIT) | |
Copyright (c) 2016 Hao-kang Den | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
import EventEmitter from 'events' | |
import shallowEqual from 'shallowEqual' | |
const shallowCompare = (instance, nextProps, nextState) => { | |
// https://github.com/facebook/react/blob/master/src/addons/shallowCompare.js | |
return ( | |
!shallowEqual(instance.props, nextProps) || | |
!shallowEqual(instance.state, nextState) | |
) | |
} |
// turnstile.js | |
let lock, open | |
lock = (action) => { | |
if (action === 'coin') { | |
return open | |
} else { | |
return lock | |
} | |
} |
/** | |
* Sinon.JS 1.15.4, 2015/06/27 | |
* | |
* @author Christian Johansen (christian@cjohansen.no) | |
* @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS | |
* | |
* (The BSD License) | |
* | |
* Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no | |
* All rights reserved. |
This pattern is heavily inspired by golang concurrency patterns
/** @jsx element */
quoted from: http://www.paulgraham.com/before.html#game
We saw this happen so often that we made up a name for it: playing house. Eventually I realized why it was happening. The reason young founders go through the motions of starting a startup is because that's what they've been trained to do for their whole lives up to that point. Think about what you have to do to get into college, for example. Extracurricular activities, check. Even in college classes most of the work is as artificial as running laps.
I'm not attacking the educational system for being this way. There will always be a certain amount of fakeness in the work you do when you're being taught something, and if you measure their performance it's inevitable that people will exploit the difference to the point where much of what you're measuring is artifacts of the fakeness.
I confess I did it myself in college. I found that in a lot of classes there might only be 20 or 30 ideas that were the right shape to make good exam questions. The