The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.
Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.
This repo also contains a bundled version of npm that has a new command, asset
. You can read the documentation for and goals of that comma
const cluster = require('cluster'); | |
const childProcess = require('child_process'); | |
const cpus = require('os').cpus().length; | |
const processes = cpus >= 2 ? cpus : 2; | |
if(cluster.isMaster){ | |
console.log("Starting server processes"); | |
for(var i = 0; i < processes; i++){ | |
cluster.fork(); |
/* global gapi */ | |
const API_KEY = 'YOURAPIKEYHERE'; | |
import React, { Component } from 'react'; | |
class App extends Component { | |
loadYoutubeApi() { | |
const script = document.createElement("script"); |
This is a proposal for a lightning talk at the Reactive 2015 conference.
NOTE: If you like this, star ⭐ the Gist - the amount of stars decides whether it makes the cut!
React just got stateless components, meaning that they are in essence pure functions for rendering. Pure functions make it dead simple - even fun - to refactor your views
. | |
├── actions | |
├── stores | |
├── views | |
│ ├── Anonymous | |
│ │ ├── __tests__ | |
│ │ ├── views | |
│ │ │ ├── Home | |
│ │ │ │ ├── __tests__ | |
│ │ │ │ └── Handler.js |
#!/bin/sh | |
# extend non-HiDPI external display on DP* above HiDPI internal display eDP* | |
# see also https://wiki.archlinux.org/index.php/HiDPI | |
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949 | |
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319 | |
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1` | |
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1` | |
ext_w=`xrandr | sed 's/^'"${EXT}"' [^0-9]* \([0-9]\+\)x.*$/\1/p;d'` |
// points = number of points (minimum 3) | |
// outer = radius to outer points | |
// inner = radius to inner points | |
module Star(points, outer, inner) { | |
// polar to cartesian: radius/angle to x/y | |
function x(r, a) = r * cos(a); | |
function y(r, a) = r * sin(a); | |
// angular width of each pie slice of the star |
;(function ($, window) { | |
var intervals = {}; | |
var removeListener = function(selector) { | |
if (intervals[selector]) { | |
window.clearInterval(intervals[selector]); | |
intervals[selector] = null; | |
} |
# add as many as you need... | |
SetEnvIf CF-IPCountry SY RedirectSubdomain=syria | |
SetEnvIf CF-IPCountry AE RedirectSubdomain=uae | |
SetEnvIf CF-IPCountry EG RedirectSubdomain=egypt | |
# Only redirect if Host is not a subdomain | |
SetEnvIfNoCase Host ^.+\.example\.com$ !RedirectSubdomain | |
# Only redirect if cookie "noredirect" doesn't exist | |
SetEnvIfNoCase ^Cookie$ noredirect=true !RedirectSubdomain |