This file contains 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
/* | |
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 |
This file contains 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
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' | |
], |
This file contains 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 { Map } from 'immutable'; | |
import { expect } from 'chai'; | |
import reducer from '../app/reducer'; | |
describe('reducer', () => { | |
describe("SETUP_GAME", () => { | |
const action = { | |
type: 'SETUP_GAME' | |
}; |
This file contains 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 { 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) { |
This file contains 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 { 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; |
This file contains 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 { 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; |
This file contains 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
<script type="text/babel"> | |
class Counter extends React.Component { | |
constructor(...args) { | |
super(...args); | |
this.state = { count: 0 } | |
} | |
render() { | |
return ( | |
<button | |
onClick={ () => |
This file contains 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
<script type="text/babel"> | |
class NameForm extends React.Component { | |
handleSubmit = event => { | |
event.preventDefault() | |
} | |
render() { | |
return ( | |
<form onSubmit={ this.handleSubmit }> | |
<label> | |
Name: |
This file contains 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'; | |
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" |
This file contains 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 ResourceForm from './components/ResourceForm.js'; | |
import ResourceList from './components/ResourceList.js'; | |
import CallForPapers from './components/CallForPapers.js'; | |
class App extends Component { | |
state = { | |
fields: {} | |
} |
OlderNewer