View grid-bookmarklet.js
javascript:(function () {
var BASE_PIXELS = 8;
var baselineNode = document.querySelector(".baseliner-overlay");
if (baselineNode) {
var body = document.body,
html = document.documentElement,
height = Math.max(body.scrollHeight, body.offsetHeight,
View higher-order-arrow-explaination.js
// ======================================
// ======================================
// Double arrows are great for creating functions
// that dont need all their arguments at once
// This is best for functions that need configuration
// before running on an active value.
// So here we have a function called
View sortable_table_exercise.js
import React, { Component } from 'react';
import './App.css';
const SORT_UP = 'up';
const SORT_DOWN = 'down';
function alphanumeric(a,b){
if(a === b){ return 0; }
return a > b ? 1 : 0;

Keystone Roles & Permissions Support

The following documents the user permission support in keystone based on the support being added via PR #2111. Permissions are based on roles. If a user has a role and the list also specifies that role for any of its CRUD operations then it is permissive for the user to perform whichever CRUD operation matches the role. All users must define, at least, one role. The following are guidelines for adding role/permission support to your application:

Define a Role List Model:

View switch-test-render.js
const Switch = (props) => <span>{props.children}</span>;
const Case = (props) => props.expr && props.children;
const TestInstantiated = (props) => {
console.log(`${}: I was rendered`);
return <div>{}</div>;
function TestSwitch() {
const val = 3;
View switch.jsx
const Switch = (props) => <span>{props.children}</span>;
const Case = (props) => props.expr && props.children;
function TestSwitch() {
const val = 3;
return (
<Case expr={val === 1}>
View switch_alternative.js
function one(){
console.log('do one');
function two(){
console.log('do two');
function three(){
console.log('do three');
View redux_simplification_1.js
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { Observable, Subject } from 'rxjs/Rx';
const stateEmitter = new Subject();
const state$ = Observable.from(stateEmitter);
const sendEvent = (data) => () => {{
View gist:f1df91251c1caf03464b
Promise.all(this.routes.filter(route => !!route).map(route => new Promise((resolve, reject) => this.context.executeAction(, state, () => resolve())).then(() => callback(null));
View SassMeister-input-HTML.html
<body class="Page-outer">
<div class="Page-inner">
<header class="PageHeader">
<h1 class="PageHeader-h1">Foo meets Baz in a Bar...</h1>
<section class="PageLayout-content">
<h1>HTML Ipsum Presents</h1>
<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>