This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Form | |
onSubmit={props.handleSubmit} | |
render={({ handleSubmit, submitting, submitError, values }) => ( | |
<form | |
className="col-md-8 offset-md-2 col-xs-12 text-center" | |
onSubmit={handleSubmit} | |
> | |
<Field name="email" validate={formValidate.required}> | |
{({ input, meta }) => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import time | |
import math | |
import datetime | |
import cv2 | |
# place a prompt on the displayed image | |
def prompt_on_image(txt): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import babel from 'rollup-plugin-babel'; | |
import commonjs from 'rollup-plugin-commonjs'; | |
import resolve from 'rollup-plugin-node-resolve'; | |
export default { | |
input: 'src/index.js', | |
output: [ | |
{ | |
file: 'lib/bundle.es.js', | |
format: 'es', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import { connect } from 'react-redux' | |
class UserContainer extends Component { | |
componentDidMount() { | |
if (!this.props.user) | |
this.props.getUser() | |
} | |
render () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// containers/user/actions.js | |
export const getUser = () => ({ | |
type: 'GET_USER', | |
payload: { | |
request: { | |
url: '/people', | |
}, | |
}, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flatten (a) { | |
return [].concat( ...a.map(x => Array.isArray(x) ? flatten(x) : x) ) | |
} | |
flatten([1, 2, [3, 4, [5], 6, [7, [8]]]]) | |
// [ 1, 2, 3, 4, 5, 6, 7, 8 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import { Field, reduxForm, SubmissionError } from 'redux-form' | |
import { connect } from 'react-redux' | |
import { required, phoneNumber, email } from 'utils/formUtils' | |
import { submitContactForm } from './actions' | |
import ReactLoading from 'react-loading' | |
import ValidationField from 'components/form/ValidationField' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hover your mouse over an element, then press ctrl + spacebar, the xPath selector will be console logged | |
var getElementXPath = function(element) { | |
if (element && element.id) | |
return '//*[@id="' + element.id + '"]' | |
else | |
return getElementTreeXPath(element) | |
} | |
var getElementTreeXPath = function(element) { | |
var paths = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tamper script to add a live filter input next to search | |
const $table = $('table.task-list') | |
const $tableBody = $table.find('tbody') | |
const $filterInput = $('<input type="search" placeholder="filter"/>') | |
const filterInput = inputText => { | |
if (!inputText || inputText.length < 3) { | |
$tableBody.find('tr.hidden').map((i, el) => { | |
$(el).removeClass('hidden') | |
}) | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup(axiosConfig = {}) { | |
// http://jsfiddle.net/coryrobinson42/r4fto1et/6/ | |
/***************** | |
SETUP & Config | |
******************/ | |
// because of Cross-Origin-Site issues we use the raw dev box url | |
window.DEV_API = 'https://howesfishing-server-crobinson42.c9users.io/' | |