(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var request = require("request"), | |
cheerio = require("cheerio"), | |
url = "https://www.google.com/search?q=data+mining", | |
corpus = {}, | |
totalResults = 0, | |
resultsDownloaded = 0; | |
function callback () { | |
resultsDownloaded++; |
const { exec } = require('child_process') | |
const fs = require('fs') | |
const rl = require('readline') | |
const i = rl.createInterface( | |
process.stdin, | |
process.stdout, | |
null | |
); |
{ | |
"[astro]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[css]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, | |
"[dockercompose]": { | |
"editor.defaultFormatter": "esbenp.prettier-vscode" | |
}, |
/* | |
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array | |
* The solutions from gist:1305056 were elegant, but wrong. So here's mine: | |
*/ | |
Array.prototype.unique = function(test) { | |
/* returns a new, sorted Array without duplicates */ | |
if (!Array.isArray(this)) | |
throw new TypeError("Array.prototype.unique must be called on an Array"); | |
return this.slice(0).sort().filter( typeof test == "function" | |
? function(v, i, a) { return !i || !test(v, a[i-1]); } |
postgres: | |
image: postgres:14.6-alpine | |
ports: | |
- '5432:5432' | |
environment: | |
POSTGRES_USER: 'user' | |
POSTGRES_PASSWORD: 'password' | |
POSTGRES_DB: 'database' | |
volumes: | |
- ./init:/docker-entrypoint-initdb.d/ |
Design an API that save game speedruns and serves a leaderboard.
In several games, finishing the game is deemed just too easy for some gamers, so they decide to see how fast they can finish the entire game. In fact, speedruns became so popular that many players compete with other players to see if they can break each other records, even if that means beating the time by just a couple of seconds. We want to create an API that can registers those records and also serve a leaderboard.