Skip to content

Instantly share code, notes, and snippets.

@cef62
cef62 / setup-modernie-vagrant-boxes.md
Created February 2, 2016 21:49 — forked from andrealbinop/setup-modernie-vagrant-boxes.md
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@cef62
cef62 / App.js
Last active January 3, 2016 17:16 — forked from fabiobiondi/App.js
EaselJS and HTML5 Canvas - ES6 Custom Display Objects (based on ES5 version: http://www.createjs.com/tutorials/Inheritance/)
import CircleButton from './CircleButton';
// Init stage
const stage = new createjs.Stage("demo");
// Button black
const btn = new CircleButton('Hi');
btn.x = 50; btn.y = 50;
stage.addChild(btn);
@cef62
cef62 / destructuring.js
Created December 3, 2015 13:42 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring.
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => {
return [1, 2, 3];
@cef62
cef62 / Enhance.js
Created November 27, 2015 17:55 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@cef62
cef62 / babel6_and_async_setup.md
Created November 20, 2015 17:05
How to config babel 6 to transpile async/await (2015-11-20)

Currently Babel 6 require its polyfill to transpile async/await. Must be explicitly installed and required in order to get async/await working.

package.json

"devDependencies": {
    "babel-core": "^6.0.20",
    "babel-polyfill": "^6.0.16",
 "babel-preset-es2015": "^6.0.15",
@cef62
cef62 / server.js
Last active November 17, 2015 17:22 — forked from maman/server.js
HTML5 API support con webpack-dev-middleware and index.html dynamically generated
/*eslint-disable */
var path = require('path');
var express = require('express');
var webpack = require('webpack');
var config = require(path.join(__dirname, 'webpack.config'));
var app = this.app = new express();
var compiler = webpack(config);
var devMiddleware = require('webpack-dev-middleware')(compiler, {
noInfo: true,
@cef62
cef62 / gist:97323b13bf4a1fdbe650
Created November 7, 2015 20:12 — forked from whisher/gist:d6e3db7c11d632720133
Hapijs brute force mitigation
'use strict';
/**
* Module dependencies.
*/
const Hoek = require('hoek');
const Limiter = require('ratelimiter');
const RedisClient = require('../utils/redis');
const ReplyUtil = require('../utils/reply');
@cef62
cef62 / app.jsx
Created October 14, 2015 17:32
React component-playground example using noRender option disabled
/* eslint new-cap:0 no-unused-vars:0 */
var React = require("react");
var ReactDom = require("react-dom");
var Playground = require("../src/index");
require("./styles/syntax.css");
require("./styles/codemirror.css");
require("./styles/demo.css");
@cef62
cef62 / readme.md
Last active August 29, 2015 14:28 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@cef62
cef62 / flattenToHierarchy.js
Created March 25, 2015 21:04
Create a hierarchical structure starting from a flatten array of nodes
(function() {
'use strict';
// original data source
var source = [{
"id": 105142,
"text": "root level",
"parent": null
}, {
"id": 105150,