Skip to content

Instantly share code, notes, and snippets.

Peter Uithoven peteruithoven

View GitHub Profile
peteruithoven / Add meta config to config.js
Last active Feb 26, 2016
STLLoader + Three.js using SystemJS
View Add meta config to config.js
meta: {
"js/app.js": {
"deps": [
"three.js/loaders/STLLoader": {
"deps": [
peteruithoven / Storing data over hot reloads
Last active Feb 11, 2016
Example of storing data over hot reloads (using capaj/systemjs-hot-reloader)
View Storing data over hot reloads
import getHotReloadStore from './utils/getHotReloadStore.js';
const hotStore = getHotReloadStore('d3d:store');
const state = hotStore.state || {
counter: 0
console.log('state: ', state);
state.counter += 1;
View rafUpdateBatcher.js
* Utility to only call Redux updates in RequestAnimationFrame's
* Also uses React-dom's batchedUpdates
import raf from 'raf';
import { unstable_batchedUpdates as batchedUpdates } from 'react-dom';
let rafID;
let notifyFunc;
function animFrame() {
peteruithoven / app.js
Last active Dec 21, 2015
Rehydrating Redux store when using systemjs hot reloader
View app.js
import {createStore} from 'redux';
import reducer from './reducers/index.js'
import { rehydrate, rehydratingStore } from './utils/rehydratingStore.js';
const store = rehydratingStore()(createStore)(reducer);
export function __reload(deletedModule){
const prevState = deletedModule.getState();
debug('Reloaded. rehydrate with state: ', prevState.sketcher.objectsById);
peteruithoven / Using reselect in reducers
Last active Oct 26, 2015
Usage reselect in Redux reducers
View Using reselect in reducers
// to the reducers.js example of ReduxExample: Todo List
// > reducers.js
// using the visibleTodosSelector of Computing Derived Data
// Using this memoized selector function enables reuse of derived data
import {visibleTodosSelector} from 'selectors/TodoSelectors.js';
function todos(state = [], action) {
View atom jspm snippets
'JSPM html':
'prefix': 'html-jsmp'
'body': """
<!DOCTYPE html>
<meta charset="utf-8">
<script src="jspm_packages/system.js" charset="utf-8"></script>
peteruithoven / broadcaster.js
Created Oct 16, 2014
Monitoring the server using pm2 indicates a memory leak. The memory usage increased and didn't decrease. Not even when stopping broadcaster.js
View broadcaster.js
var io = require('');
var PORT = 6000;
var socket = io.connect('http://localhost:'+PORT,{forceNew:true});
socket.once('connect',function() {
setInterval(function() {
console.log("emit image");
for(var i=0;i<100;i++) {
View dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
You can’t perform that action at this time.