Skip to content

Instantly share code, notes, and snippets.

View danielgormly's full-sized avatar

Daniel danielgormly

View GitHub Profile
@danielgormly
danielgormly / get-my-gamespot-games.js
Last active December 18, 2022 03:49
Pull ratings from your Gamespot profile and save as json
const { parse } = require('date-fns');
const { JSDOM } = require('jsdom');
const { writeFileSync } = require('fs');
async function main() {
const outputFile = 'output.json';
const outputData = [];
for (let i = 1; i <= 10; i++) {
const res = await fetch(`https://www.gamespot.com/profile/reviews/?page=${i}`, {
"credentials": "include",
@danielgormly
danielgormly / Dockerfile
Created March 5, 2018 03:12
Amazon Linux NPM Install
FROM amazonlinux
ENV VERSION="8.9.4"
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
&& [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" \
&& nvm install $VERSION
ENV PATH="${NVM_DIR}/versions/node/v${VERSION}/bin:${PATH}"
WORKDIR /var/task
@danielgormly
danielgormly / MiniKoa.js
Last active March 19, 2017 06:43
Microcosm of Koa's flow control
/*
MiniKoa ^.^
- In the real Koa, the module Koa-composer takes on the recursive behaviour.
- This still works with async functions because await will automatically convert resolved values into promises.
- The most notable difference of course is that this doesn't respond to an http request instead it just runs instantly with whatever context object you give it.
*/
class MiniKoa {
constructor() {
this.middleware = [];