- What is tic tac toe?
- Build a data structure to represent the game board.
- Write a function that updates the board with somebody's chosen position. Don't worry about detecting if somebody has won.
- Write a function to detect that somebody has won.
- What should the UI look like? Use excalidraw to mock up the layout of the page
- Set up codesandbox.io with React and draw the board using the data structure we built earlier. Don't make it interactive, just draw the board.
- Add a feature so that clicking on the board fills the spot.
- Show a message when the game is over.
Algorithms notes
- Implement binary search in js without recursion
- implement quick sort in py and js
- implement merge sort in js
for queues, you dequeue from 0 and enqueue at -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
function curry(func, ...argv) { | |
let prevArgs = argv; | |
function innerCurry(...args) { | |
prevArgs.push(...args) | |
if (prevArgs.length === func.length) { | |
return func(...prevArgs); | |
} | |
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
const fs = require("fs"); | |
const getTimerTemplate = (platform, importType, interval) => ` | |
[Unit] | |
Description=Run ${platform}-${importType} every 15 minutes | |
Requires=${platform}-${importType}.service | |
[Timer] | |
Unit=${platform}-${importType}.service | |
OnUnitInactiveSec=${interval} |
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
const StatsD = require("hot-shots"); | |
const statsdclient = new StatsD(); | |
const properties = Object.getOwnPropertyNames( | |
Object.getPrototypeOf(statsdclient) | |
); | |
const client = properties.reduce((prev, property) => { | |
if (property === "constructor") { |
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
gulpTask = (name, fn) => { | |
done = (err) => { | |
if (err) { | |
console.log(`Completed task "${name}" with error`); | |
console.error(err) | |
} | |
else { | |
console.log(`Completed task "${name}" successfully`); | |
} | |
} |
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
const stringToDom = (string) => document.createRange().createContextualFragment(string); | |
function viewTest(test) { | |
window.location.hash = test.id; | |
document.querySelector('#viewer').innerHTML = ` | |
<iframe src="${test.link}"></iframe> | |
`; | |
} | |
fetch('/tests') |
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
export function* getMissingRates(orderNumbers, labelType) { | |
const ratesDeltaByOrderNumber = {}; | |
const orderNumbersMissingRates = yield select(orderNumbersMissingRatesSelector, {orderNumbers, labelType}); | |
if (!orderNumbersMissingRates.length) { | |
return; | |
} | |
yield put(startUpdatingRates(orderNumbersMissingRates, labelType)); |
Create an object with all your action creators. This makes it easier to debug your application, since now you can dispatch actions from the console or from the Redux Devtools Extension.
ActionRegistry['data/accountBalance'].SET_ACCOUNT_BALANCE // "ordoro/data/accountBalance/SET_ACCOUNT_BALANCE"
ActionRegistry['data/accountBalance'].setAccountBalance(3) // {type: "ordoro/data/accountBalance/SET_ACCOUNT_BALANCE", payload: 3}
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
http://www.capmetro.org/metrolabs/ | |
Open Data License Agreement and Terms of Use | |
Capital Metropolitan Transportation Authority (CMTA) hereby grants you (Licensee) non-exclusive, limited and revocable rights to use, reproduce, and redistribute CMTA Data (Data) hosted on the Socrata (http://www.socrata.com/) platform on data.texas.gov portal subject to the following Terms: | |
This data may include one or more of the following: CMTA Vehicle Location data, CMTA Service Alerts data, CMTA Trip Update Data, General Transit Feed Specification (“GTFS”) formatted data sets, Scheduled Service data, and Maps data. | |
CMTA trademarks and copyrighted materials, including any confusingly similar variants, may not be used in association with Data. | |
Data is provided on an "as is" and "as available" basis. CMTA makes no representations or warranties of any kind, express or implied. CMTA disclaims all warranties, express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpos |
NewerOlder