Skip to content

Instantly share code, notes, and snippets.

View michaelrambeau's full-sized avatar

Michael Rambeau michaelrambeau

View GitHub Profile
@michaelrambeau
michaelrambeau / plugin.js
Created August 27, 2014 08:58
Adjustments made to Keystone Social Login (KSL) plugin
//users authenticated from passport have no password.
var passwordField = list.schema.paths.password;
passwordField.options.required = false;
passwordField.isRequired = false;
var MyComponent = React.createClass({
getDefaultProps: function() {
return {
title: 'My defaut title'
};
},
getInitialState: function() {
return {
@michaelrambeau
michaelrambeau / file0.html
Last active August 29, 2015 14:24
An introduction to modern JavaScript: ES6, modules... ref: http://qiita.com/michaelrambeau/items/bf079b5b48507792807f
<tbody>
{ entries.map( function (entry, i) {
return(<RestoreLogList.Entry
entry={ entry }
key={ i }
/>);
}
@michaelrambeau
michaelrambeau / webpack-devserver.js
Created February 27, 2016 13:33
Script to launch webpack dev server (instead of using `webpack-dev-server --content-base www --hot` command).
// node.js server used to serve assets bundled by Webpack
// use `npm start` command to launch the server.
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../../config/webpack.local.config');
console.log('Starting the dev web server...');
const port = 8080;
const path = require('path');
const options = {
@michaelrambeau
michaelrambeau / app.js
Created March 3, 2016 22:25
react fire simple test
const App = React.createClass({
mixins: [ReactFireMixin],
increment() {
this.setState({counter: this.state.counter + 1})
},
reset() {
this.setState({counter: 0})
},
render() {
return (
@michaelrambeau
michaelrambeau / README.md
Last active September 27, 2016 12:47
Full-Stack Frameworks

Here we are talking about solutions to build web applications from the back-end side (including the database and the web server) to the front-end layer using only one language (JavaScript).

Let's face the truth: unlike other categories like front-end frameworks, there are very very few contenders in this category where Meteor is the king. We could mention DerbyJS as a contender but it has little traction.

Interest - satisfaction

In this category, Meteor is the pionner, with an active community and a strong eco-system, so it's not a surprise that it's known by 90% of people who anwsered the survey.

Meteor may be the most popular solution (more than 35,000 stars on Github), the "MEAN" (Mongo + Express + AngularJS + node.js) stack was used by almost twice more users in our survey (3000 vs 1700).

@michaelrambeau
michaelrambeau / README.md
Last active March 11, 2017 06:17
Trying Vue.js

A basic example using a simple HTML page with some old-fashioned script tags (no ES6, no building process)

GOAL: display the list of projects from bestof.js.org

├── index.html
└── js
    ├── app.js
    ├── components.js
@michaelrambeau
michaelrambeau / README.md
Last active April 2, 2017 09:50
To curry or not curry, that is the question

Comparing 2 implementations of the same function, with and without currying.

To be run from Ramda playground: http://ramdajs.com/repl/

@michaelrambeau
michaelrambeau / Routes.js
Created April 13, 2017 07:53
React Router v4
import React from 'react'
import Home from './Home'
import Header from './Header'
import ProjectList from './ProjectList'
import ProjectItem from './ProjectItem'
import { Route, Switch } from 'react-router-dom'
const NoMatch = () => (<div>No match!</div>)
const ProjectItemReadme = () => (<div>This is a wonderfull project!</div>)
@michaelrambeau
michaelrambeau / micro.js
Created May 21, 2017 06:10
Micro-services
require('dotenv').config()
const { send } = require('micro')
const mongoose = require('mongoose')
const Restaurant = require('./models/Restaurant')
require('./models/Tag')
mongoose.Promise = global.Promise
module.exports = (req, res) => {
res.setHeader('Access-Control-Allow-Origin', '*')