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 class EmployeeList extends React.Component { | |
state = { | |
employees: [], | |
isLoading: true | |
} | |
componentDidMount() { | |
if (localStorage.token) { | |
this.loadEmployeesData() | |
} |
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
File 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 random | |
american_adult_population = int(245e6) | |
# Warning: This array is HUGE! | |
# The array is just the numbers from 0 to 245,000,000 | |
usa_array = range(american_adult_population) | |
actual_average = float(american_adult_population / 2) | |
sample_amount = 1500 |
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
module HangmanGuesser (main) where | |
import Data.List (intersect, nub, sort) | |
import Data.Char (toLower) | |
import Data.Tuple (swap) | |
import Data.Map as M (Map, fromListWith, toList) | |
main = do | |
corpus <- readFile "web2" |
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 { Schema, arrayOf } from 'normalizr' | |
let userSchema = new Schema('user', options) | |
let nbhdSchema = new Schema('nbhd', options) | |
let itemSchema = new Schema('item', options) | |
let commentSchema = new Schema('comment', options) | |
let nbhdsSchema = arrayOf(nbhdSchema) | |
userSchema.define({ | |
nbhds: nbhdsSchema |
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
fizzes = cycle ["", "", "Fizz"] | |
buzzes = cycle ["", "", "", "", "Buzz"] | |
fbs = zipWith (++) fizzes buzzes | |
nums = map show [1..] | |
fizzbuzz n = take n (zipWith max nums fbs) | |
-- Usage: | |
-- fizzbuzz 3 | |
-- -> ["1", "2", "Fizz"] |
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const models = require('../models'); | |
for (const model in models) { | |
const tableName = models[model].tableName; | |
let defaultValue = ''; | |
let onUpdate = ''; |
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 from 'react'; | |
function Spenses({ items }) { | |
function deleteItem({ id, amount }) { | |
// Delete the item. | |
} | |
return ( | |
<> | |
{items.map((item, index) => ( |