Skip to content

Instantly share code, notes, and snippets.

package org.maximf
object P50 {
def main(args: Array[String]) {
println(go(1000000))
}
def go(limit: Long): Long = {
val primes = Primes.below(limit).toArray
val set = primes.toSet
export default class JobQueue {
constructor(collection, identifier, pendingJobs, queuedJobs) {
this.collection = collection;
this.identifier = identifier;
const context = {
queue: [],
pendingJobs: pendingJobs,
queuedJobs: queuedJobs
export default function JobQueue(collection, identifier, pendingJobs, queuedJobs) {
const queue = [];
this.collection = collection;
this.identifier = identifier;
this.enqueue = jobDescription => {
log.debug(`QUEUE - queue: ${jobDescription}`);
const queueEmpty = this.isEmpty();
export default class JobQueue {
constructor(collection, identifier, pendingJobs, queuedJobs) {
this.collection = collection;
this.identifier = identifier;
// All public, do not care about incapsulation
this.queue = [];
this.pendingJobs = pendingJobs;
this.queuedJobs = queuedJobs;
import React from "react"
import Confetti from "react-confetti"
const size = 10
export default function Playground() {
const [tiles, setTiles] = React.useState(getNewTiles)
const tileElements = tiles.map(tile => new Tile(tile))
const isGameOver = new Set(tiles.map(tile => tile.value)).size === 1
const onClick = () => setTiles(isGameOver ? initTiles() : generateTiles())