Skip to content

Instantly share code, notes, and snippets.

Mocha {
files: [ '/Users/davidfox-powell/dev/sos-server/test/unit/server-middleware-spec.js' ],
options: { reporterOptions: {}, globals: [] },
suite:
Suite {
title: '',
ctx: {},
suites: [],
tests: [],
pending: false,
import {isJSON} from '../utils/is-json';
import request from './superagent';
export async function({method = 'GET', url}) {
method = method.toUpperCase();
const methods = ['GET', 'POST'];
let [foundMethod] = methods.filter(m => method === m);
if (!foundMethod) {
throw new Error('you specified an unknown method')
import reactor from '../modules/bootstrap';
import serverMod from '@hfa/sos-server/lib/modules/server';
import formMetaMod from '../modules/form-meta';
import {Getters as FormGetters, makeActions as makeFormActions} from '@hfa/form-components';
import {analytics} from '../config';
import {isFunction} from '../utils/lodash';
class BootStrap {
constructor() {
const {_reactor = '{}'} = global.hfaGlobals || {};
export default [
{title: 'red', message: 'I\'m red', color: 'red'},
{title: 'blue', message: 'I\'m blue', color: 'blue'},
{title: 'green', message: 'I\'m green', color: 'green'}
]
import {get as getFormData} from './form-data.js';
class FormComp extends Component {
constructor(props) {
super(props);
this.inputs = getFormDate({omit: ['zipcode']}).map((inputData, i) => <Input {...inputData} key={`form_comp_${i}`} required />);
}
render() {
return (
@provideReactor(provideContextProps)
class Wrapper extends Component {
static propTypes = {
children: PropTypes.array.isRequired
};
render() {
<div>
{this.props.children}
</div>
/*
* Objects
*/
const props = {
1: 1,
2: 2,
3: 3,
4: 4
}
const {a,b, ...rest} = props //a = 1, b = 2, rest = {3: 3, 4: 4}
//colors
/^(?:#?[a-f\d]+|[a-s]{1,4}\s?\([\d%\s,.]+\))$/i
'hsla(0, 10%, 50%, 0.5)'
'#000000000'
'#11111'
'argb(1,1,1)'
'hsl (20,0%, 50%)'
'hsl(20, 20%, 20%)'
'#6F6F6F'
import request from 'superagent';
import cheerio from 'cheerio';
import vo from 'vo';
import {readFile} from 'fs';
/**
* An example generator
*/
function *gen(init) {
//confusing because what is stored in `first` variables is not what is returned from