Skip to content

Instantly share code, notes, and snippets.

View wclr's full-sized avatar
🔥
Fighting the SUN

Alex wclr

🔥
Fighting the SUN
  • Need a light, hah?
  • Upper Worlds
View GitHub Profile
const webpack = require('webpack')
const dev = process.env.NODE_ENV = process.env.NODE_ENV || 'webpack-development'
module.exports = {
entry: [
//'webpack-dev-server/client?http://cycle-hmr-webpack.127.0.0.1.til.io:2000',
'webpack-dev-server/client',
'webpack/hot/only-dev-server',
__dirname + '/app.js'
@wclr
wclr / Event-stream based GraphQL subscriptions.md
Created April 5, 2016 11:44 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@wclr
wclr / main.js
Created March 5, 2016 21:31 — forked from staltz/main.js
Cycle.js demo with MIDI and Web Audio
import {Observable, Disposable} from 'rx';
import {run} from '@cycle/core'
const jsondiffpatch = require('jsondiffpatch').create({
objectHash: function(obj) {
return obj.name;
}
});
function generateCurve(steps){
var curve = new Float32Array(steps)
@wclr
wclr / react-driver.js
Created February 25, 2016 12:23 — forked from justinwoo/react-driver.js
A React driver for Cycle.js that handles injection via context. Warning: you should probably not actually use this and prefer making your own driver with props instead.
/* @flow */
import Rx from 'rx';
import React from 'react';
import ReactDOM from 'react-dom';
export function makeReactDriver<T>(
containerId: string,
childContextTypes: any,
getChildContext: () => {[key: string]: () => void},
can.Component({
tag: 'my-toggle',
template: '<button can-click="toggle">Toggle</button>',
scope: {
toggle: function(){
this.attr('shown', !this.shown)
}
}
@wclr
wclr / steal-lp.js
Last active December 9, 2015 07:53
StealJS plugin to dynamiclty load language (resouces) packs
var getWindowLoader = function(name){
return `
module.exports = function(lang){
return System.import("${name}" + "/" + lang + ".js!" + lang + ".lp")
}
`
}
var getNodeLoader = function(name, address, load){
var fs = require('fs')
<preference name="phonegap-version" value="cli-5.1.1" />
<preference name="permissions" value="none" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="FullScreen" value="true" />
<gap:plugin name="cordova-plugin-device" source="npm" />
<gap:plugin name="cordova-plugin-file-transfer" source="npm" />
<gap:plugin name="cordova-plugin-globalization" source="npm" />
<gap:plugin name="cordova-plugin-inappbrowser" source="npm" />
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.my.mobile.dev" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>My (Dev)</name>
<description>Official Mobile Application (Dev).</description>
<author email="feedback@my.com" href="http://my.com"> Team</author>
<content src="index.html" />
<preference name="phonegap-version" value="cli-5.1.1" />
<preference name="permissions" value="none" />
<preference name="auto-hide-splash-screen" value="false" />
<preference name="deployment-target" value="7.1" />
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at EventEmitter.addListener (events.js:160:15)
at Server.connect (...\node-app\node_modules\mongoose\node_modules\mongodb\lib\server.js:291:17)
at Db.open (...\node-app\node_modules\mongoose\node_modules\mongodb\lib\db.js:190:19)
at MongoStore._open_database (...\node-app\node_modules\connect-mongo\lib\connect-mongo.js:174:15)
at MongoStore._get_collection (...\node-app\node_modules\connect-mongo\lib\connect-mongo.js:169:14)
at ...\node-app\node_modules\connect-mongo\lib\connect-mongo.js:186:16
at ...\node-app\node_modules\mongoose\node_modules\mongodb\lib\db.js:200:5
at connectHandler (...\node-app\node_modules\mongoose\node_modules\mongodb\lib\server.js:272:7)