Skip to content

Instantly share code, notes, and snippets.

@nns2009
nns2009 / Google Photos - Mass Metadata Export.js
Created September 1, 2025 17:57
Script to export all metadata (filename, date taken, size, etc.) from all media (photos and videos) in your Google Photos library
/*
Script to export all metadata (filename, date taken, size, etc.) from all media (photos and videos) in your Google Photos library.
Based on this script from Reddit user "HalBenHB":
https://www.reddit.com/r/googlephotos/comments/1lf6dz0/a_script_to_export_all_your_photo_video_metadata/
but enhanced to save all downloaded data and importantly to be continue-able in case of failures.
The post in this ^ link also contains a script to export data of specific albums only (I didn't use or enhance it).
Uses "Google Photos Toolkit"
https://github.com/xob0t/Google-Photos-Toolkit
@nns2009
nns2009 / PromiseAwaitSpeedTest.js
Last active August 4, 2025 01:10
I was wondering how much overhead Promise.resolve and Promise.race have. Turns out: relatively huge, but at the same time - insignificant in absolute delay for the use-case I was considering.
let sleep = s => new Promise(resolve => setTimeout(resolve, s * 1000));
let asyncResolve = v => new Promise(resolve => setTimeout(() => resolve(v), 0));
async function simplePromiseTime(promiseStart) {
let before = performance.now();
await promiseStart();
let after = performance.now();
return (after - before) / 1000;
}
@nns2009
nns2009 / FacebookExpandComments.js
Created June 25, 2025 12:52
Facebook: Expand all "View ..." comments
// This script slowly but surely expands all comments of a Facebook post
// (pretty annoying Facebook doesn't have this feature with a single click)
// Manually select "All comments" before launching in the console
// The class selector will likely change
// I might update it with a more robust version someday
// Note that even this class selector is somehow not enough, so extra textContent filtering is used
let sleep = s => new Promise((resolve, _) => setTimeout(resolve, s * 1000));
let random = (min, max) => min + Math.random() * (max - min);
@nns2009
nns2009 / 0 - Worst game of the jam - Video making.md
Last active September 17, 2022 15:24
Worst game of the jam - Video making

Watch the video about how I made the Worst game of the Brackeys jam (out of 1086):

https://youtu.be/Tpeu1-gqA3o

These are Google Chrome console scripts I used to make this video in the order I used them

// ----------------------------------------------------------
// ----------------------------------------------------------
// --------------------- Farm with Code ---------------------
// ----------------------------------------------------------
// ----------------------------------------------------------
// In this game you need to code your drone(s) in JavaScript to farm for you.
// Here is a sample code to do some farming.
// Read game page for more instructions.
# Made in 21 second
# Watch this video to see how:
# https://youtu.be/r3a9obNqno4
from random import randint
m = 5
while True:
a = randint(m, 3*m)
b = randint(m, 3*m)
print(f'{a} * {b} = ?')
@nns2009
nns2009 / Bachet game in 1 minute.py
Last active October 9, 2022 11:49
I made a game (Bachet/Nim) in under one minute (once again, this is the second one), here it is
# Made in 43 seconds
# Watch this video to see how:
# https://youtu.be/vnYES_fba-M
from random import randint
n = randint(20, 30)
while True:
print(f'{n:2}', '|' * n)
@nns2009
nns2009 / ParametricObjectEditor.cs
Created November 14, 2020 23:10
Unity custom editor for parametric objects
// This script is the common part of the set up to use parametric objects in Unity:
// Watch the video-tutorial with explanation here:
// https://youtu.be/KCDYdQUufhs
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(Room))]
@nns2009
nns2009 / CountSort.js
Last active October 7, 2020 18:12
Count sort made while counting every single key pressed
// Count sort I coded while counting every single key I press
// Watch video here:
// https://youtu.be/HFgzhYHM4QM
function countSort(vs) {
const cs = Array(Math.max(...vs) + 1).fill(0);
let res = [];
for (let v of vs)
cs[v]++;
for (let v = 0; v < cs.length; v++) {
for (let c = 0; c < cs[v]; c++)
@nns2009
nns2009 / 10 Minute Game.cs
Created September 20, 2020 00:26
Polished maze game made in under 10 minutes with Unity
// Made from scratch in just 8 minutes 23 seconds
// Watch this video to see how:
// https://youtu.be/aP9eKrnyxe4
// Play online here:
// https://nns2009.itch.io/just-maze
using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;