Skip to content

Instantly share code, notes, and snippets.

View ergomancer's full-sized avatar
💭
just learning one command at a time

Akash Khetan ergomancer

💭
just learning one command at a time
View GitHub Profile
@ergomancer
ergomancer / reset.css
Last active July 1, 2025 06:10
A CSS reset off Josh Cameau's blog.
/*
CSS Reset inspired from Josh's version at
https://www.joshwcomeau.com/css/custom-css-reset/
*/
/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
box-sizing: border-box;
}
@ergomancer
ergomancer / countryPPPData.js
Last active January 3, 2026 16:03
A script to fetch Purchasing Power Parity (PPP) data from the World Bank API.
/*
v1.0.x
NPM Package: npm install countrypppdata
*/
const axios = require("axios");
const { getCodes, getCodeList } = require("country-list");
async function fetchCountryData() {
let countries = getCodes();
@ergomancer
ergomancer / merge-sort.js
Last active June 18, 2025 15:37
A merge sort alogrithm in JS
const merge = function (arr1, arr2) {
let output = [];
let target;
while (true) {
if (arr1.length == 0 && arr2.length == 0) break;
else if (arr1.length == 0 && arr2.length != 0) target = arr2;
else if (arr1.length != 0 && arr2.length == 0) target = arr1;
else {
if (arr1[0] > arr2[0]) target = arr2;
else target = arr1;