Skip to content

Instantly share code, notes, and snippets.

View nlssn's full-sized avatar
💻
clicketyclackin'

Johannes Nilsson nlssn

💻
clicketyclackin'
View GitHub Profile
import puppeteer from "puppeteer";
import * as cheerio from "cheerio";
import fs from "fs";
import jsonexport from "jsonexport";
(async () => {
// Launch the browser and open a new blank page
const browser = await puppeteer.launch({ headless: false });
const page = await browser.newPage();
@nlssn
nlssn / sort-wc-categories.php
Last active April 23, 2023 10:41
Dirty solution to wp_list_categories not respecting the order of manually sorted WooCommerce categories
<?php
// Get the IDs of all product categories
$categories_args = array(
'taxonomy' => 'product_cat',
'fields' => 'ids',
);
$categories = get_terms( $categories_args );
// Get the previously fetched categories, and output them in a nicely formatted list
@nlssn
nlssn / code_colors_discordjs.md
Last active June 7, 2021 08:51 — forked from thomasbnt/code_colors_discordjs.md
Code colors for embed discord.js

Here is an updated list of the colors that are currently implemented with a name

Name Int value Hex Code
DEFAULT 0 #000000
AQUA 1752220 #1ABC9C
DARK_AQUA 1146986 #11806A
GREEN 3066993 #2ECC71
DARK_GREEN 2067276 #1F8B4C
BLUE 3447003 #3498DB