DEPRECATED: See https://gist.github.com/nicolashery/9414d2357258718891e3
Pressing "space" a bunch of times, I expect main
to receive only one "key" message on the spaceCh
, but it receives 2?
DEPRECATED: See https://gist.github.com/nicolashery/9414d2357258718891e3
Pressing "space" a bunch of times, I expect main
to receive only one "key" message on the spaceCh
, but it receives 2?
// https://github.com/jlongster/js-csp | |
// Throttle ported from: | |
// https://gist.github.com/swannodette/5886048 | |
var csp = require('js-csp'); | |
var chan = csp.chan; | |
var go = csp.go; | |
var put = csp.put; | |
var take = csp.take; | |
var timeout = csp.timeout; |
var merge = require('react/lib/merge'); | |
var m = require('mori'); | |
var toArray = function (val) { | |
if (!Array.isArray(val)) { | |
val = [val]; | |
} | |
return val; | |
}; |
This shows a way to have "environment variables" working for both the webpack-dev-server (local development) and the Divshot server (to test a build locally).
Problem:
.env.json
file in the project directory, and uses it to serve a __/env.js
file__/env.js
file ourselvesA solution:
I hereby claim:
To claim this, I am signing this object:
// https://github.com/gaearon/redux | |
// example/Counter.js | |
import React from 'react'; | |
import { performs, observes } from 'redux'; | |
// Explicit import of stores/actions so you know what your component depends on | |
// (could also be useful for some static analysis tool?) | |
import { increment, decrement } from './actions'; | |
import { CounterStore } from './stores'; |
// Flux actions called by views (components) are meant to be "fire and forget": | |
// the view will get an update after the dispatcher has updated the store. | |
// | |
// But sometimes, for view state that only really matters to the mounted | |
// component (like a loading indicator), it might be simpler to have | |
// a "done" callback in the action creator. This is considered a Flux | |
// anti-pattern, but if you don't actually pass data to the callback, you | |
// make sure not to break the "store = single-source of truth" principle. | |
// For example, let's say we have a widget that allows the user to add places |
This is a simple Python script to serve static files from any project directory, useful when doing web development.
Simply put server.py
and server.cmd
in a directory, for instance C:\Users\YourName\bin
and add that directory to your PATH
.
Then in the console, cd
to your project folder, type server
and hit Enter (it will run on port 8000
by default, use server 5000
for example to change port). Use Ctrl+C
to stop the server.
Windows PowerShell | |
Copyright (C) 2012 Microsoft Corporation. All rights reserved. | |
> chocolatey update -pre | |
The most recent version of chocolatey available from '-Source "http://chocolatey.org/api/v2/" -Source "https://go.microsoft.com/fwlink/?LinkID=230477" ' (if value is empty, using sources in nuget.config file) is 0.9.8.20-beta1. On your machine you have 0.9.8.19 installed. | |
===================================================== | |
Chocolatey (0.9.8.19) is installing chocolatey to "C:\Chocolatey\lib". By installing you accept the license for the | |
package you are installing (please run chocolatey /? for full license acceptance terms). | |
===================================================== |
/* @flow */ | |
import _ from "lodash"; | |
type UserId = string; | |
type UserRole = | |
'admin' | | |
'guest' | | |
'member'; |