Skip to content

Instantly share code, notes, and snippets.

@mojouy
mojouy / package.json
Created June 24, 2018 02:31 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Buczynski",
"url": "http://adambuczynski.com"
},
"license": "UNLICENSED",
@mojouy
mojouy / fakeAction.js
Last active June 7, 2018 10:53
Fake Redux Action with delay
import delay from './delay'; // This is a const with Miliseconds
// This file mocks a web API by working with the hard-coded data below.
// It uses setTimeout to simulate the delay of an AJAX call.
// All calls return promises.
const authors = [
{
id: 'cory-house',
firstName: 'Cory',
lastName: 'House'
@mojouy
mojouy / Component.jsx
Created March 11, 2016 12:29
es6 React bind this
class BaseComponent extends React.Component {
_bind(...methods) {
methods.forEach( (method) => this[method] = this[method].bind(this) );
}
}
class ExampleComponent extends BaseComponent {
constructor() {
super();
this._bind('_handleClick', '_handleFoo');
@mojouy
mojouy / capybara cheat sheet
Created March 9, 2016 14:02 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')