Skip to content

Instantly share code, notes, and snippets.

View parkerproject's full-sized avatar

Parker parkerproject

View GitHub Profile
@parkerproject
parkerproject / gulpfile.js
Created July 16, 2016 17:18 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
@parkerproject
parkerproject / .eslintrc.js
Created August 5, 2016 14:30 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@parkerproject
parkerproject / index.html
Created August 17, 2016 23:41 — forked from mbajur/index.html
Working example of window.postMessage used for sending data from popup to parent page (works in IE)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Index</title>
<script type="text/javascript">
window.open ("popup.html","mywindow", "width=350,height=250");
// Create IE + others compatible event handler
module.exports = {
'extends': 'airbnb',
'installedESLint': true,
'plugins': [
'react',
],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"no-console": ["error", { allow: ["warn", "error", "log"] }]
},
@parkerproject
parkerproject / redux-form-tut.js
Created August 18, 2016 18:47 — forked from dmeents/redux-form-tut.js
The source code for the redux form tutorial on davidmeents.com
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import * as actions from '../../actions';
const form = reduxForm({
form: 'ReduxFormTutorial',
validate
});
@parkerproject
parkerproject / .babelrc
Created August 25, 2016 16:48 — forked from Calamari/.babelrc
Webpack, Karma, jasmine, react Boilerplate
{
"presets": ["es2015", "react"],
"plugins": [
"add-module-exports",
"transform-object-rest-spread",
"transform-class-properties",
"transform-flow-strip-types"
]
}
var form,
docfrag,
formId,
inputString1,
inputString2,
inputNameString1,
inputNameString2;
docfrag = document.createDocumentFragment();
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
@parkerproject
parkerproject / gist:9a7576eaed6924a3a7055732c504cd9b
Created September 20, 2016 21:11 — forked from eshiota/gist:4130937
Testing form submission with jQuery and Jasmine
// sizeSelectionModule and addToCartModule are local variables that
// act as shortcuts to their namespaces
describe("when add to cart form is submitted", function () {
var $form;
beforeEach(function () {
// We use div instead of form so we can just mock the submit behavior
$form = $("<div />");
});
var numbers = [0,1,2,3,5,8,9,11];
var sum = 17;
function ifTwoNumbersEqualSum(arr, sum){
var innerArr = [];
for(var k = 0, len = numbers.length; k < len; k++){
var difference = sum - numbers[k];