Skip to content

Instantly share code, notes, and snippets.

View ryardley's full-sized avatar

гλ ryardley

View GitHub Profile
var msg = 'hello world';
function doSomething(){
var msg = 'foo';
function inner(){
return msg;
}
return inner();
}
expect(msg).toEqual('hello world');
@ryardley
ryardley / SassMeister-input-HTML.html
Created February 22, 2015 12:31
Generated by SassMeister.com.
<html>
<div class="MyMedia">
<img class="MyMedia-left" src="https://avatars3.githubusercontent.com/u/1256409?v=3&s=460" />
<div class="MyMedia-right">
<h1 class="MyMedia-h1">Beer me</h1>
<p>Flexitarian bitters Pitchfork tofu, PBR synth taxidermy sartorial artisan. Banksy letterpress direct trade polaroid fingerstache. Yr organic VHS, fixie gluten-free scenester ethical Williamsburg</p>
<p class="MyMedia-more">More...</p>
</div>
</div>
</html>
@ryardley
ryardley / SassMeister-input-HTML.html
Last active August 29, 2015 14:15
Generated by SassMeister.com.
<html>
<body class="Page-outer">
<div class="Page-inner">
<header class="PageHeader">
<h1 class="PageHeader-h1">Foo meets Baz in a Bar...</h1>
</header>
<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>
@ryardley
ryardley / gist:f1df91251c1caf03464b
Created March 28, 2015 08:53
fat arrow of perplexity
Promise.all(this.routes.filter(route => !!route).map(route => new Promise((resolve, reject) => this.context.executeAction(route.data, state, () => resolve())).then(() => callback(null));
@ryardley
ryardley / redux_simplification_1.js
Created June 16, 2016 08:57
Exploring redux alternatives
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) => () => {
stateEmitter.next({
function one(){
console.log('do one');
}
function two(){
console.log('do two');
}
function three(){
console.log('do three');
const Switch = (props) => <span>{props.children}</span>;
const Case = (props) => props.expr && props.children;
function TestSwitch() {
const val = 3;
return (
<Switch>
<Case expr={val === 1}>
const Switch = (props) => <span>{props.children}</span>;
const Case = (props) => props.expr && props.children;
const TestInstantiated = (props) => {
console.log(`${props.id}: I was rendered`);
return <div>{props.id}</div>;
}
function TestSwitch() {
const val = 3;
@ryardley
ryardley / keystone_roles_permissions.md
Created August 28, 2016 01:20 — forked from webteckie/keystone_roles_permissions.md
Keystone Roles and Permissions

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:

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;
}