Skip to content

Instantly share code, notes, and snippets.

View dapperAuteur's full-sized avatar
🏠
teach what's been taught.

dapperAuteur dapperAuteur

🏠
teach what's been taught.
View GitHub Profile
/*
Sales from an online furniture store
Collected by: https://www.khanacademy.org/profile/charlesb2000/
*/
CREATE TABLE sales(
ID INTEGER NOT NULL PRIMARY KEY
, transaction_date TEXT
, product TEXT
, price INTEGER
, payment_type TEXT
var webpack = require('webpack');
const path = require('path');
module.exports = {
entry: [
'webpack-dev-server/client?https://0.0.0.0:8080',
'webpack/hot/only-dev-server',
'./app/index.js'
],
import { Map } from 'immutable';
import { expect } from 'chai';
import reducer from '../app/reducer';
describe('reducer', () => {
describe("SETUP_GAME", () => {
const action = {
type: 'SETUP_GAME'
};
import { Map } from 'immutable';
import { newGame, game } from './components/game/game';
const setupGame = () => {
let game = newGame();
const newState = new Map({})
};
export default function(currentState=new Map(), action) {
import { fromJS, List } from 'immutable';
export const newGame = () => {
let awayTeam = 0;
let homeTeam = 0;
let balls = 0;
let strikes = 0;
let fouls = 0;
let outs = 0;
let inning = 1;
import { fromJS, List } from 'immutable';
import seedrandom from 'seedrandom';
export const shuffle = (array, seed) => {
let j, x, i;
for (i = array.length; i; i -= 1) {
j = Math.floor(seedrandom(seed + i)() * i);
x = array[i - 1];
array[i - 1] = array[j];
array[j] = x;
@dapperAuteur
dapperAuteur / use_class_components_with_react_0.html
Created December 30, 2017 23:36
Egghead.com The Beginner's Guide To ReactJS Tutorial: Use Class Components With React
<script type="text/babel">
class Counter extends React.Component {
constructor(...args) {
super(...args);
this.state = { count: 0 }
}
render() {
return (
<button
onClick={ () =>
@dapperAuteur
dapperAuteur / make_basic_forms_with_react.html
Created December 30, 2017 23:44
Egghead.com The Beginner's Guide To ReactJS Tutorial: Make Basic Forms With ReactJS
<script type="text/babel">
class NameForm extends React.Component {
handleSubmit = event => {
event.preventDefault()
}
render() {
return (
<form onSubmit={ this.handleSubmit }>
<label>
Name:
@dapperAuteur
dapperAuteur / ResourceList.js
Created January 2, 2018 20:56
this is the component with the list and it's imported into another component
import React, { Component } from 'react';
export default class ResourceList extends Component {
constructor(props) {
super(props);
this.state = {
cfps: [
{
"title": "it conferences call for papers list",
"link": "https://github.com/softwaremill/it-cfp-list"
@dapperAuteur
dapperAuteur / App.js
Created January 2, 2018 20:57
the previous file ResourceList.js is imported into this file/component
import React, { Component } from 'react';
import ResourceForm from './components/ResourceForm.js';
import ResourceList from './components/ResourceList.js';
import CallForPapers from './components/CallForPapers.js';
class App extends Component {
state = {
fields: {}
}