Skip to content

Instantly share code, notes, and snippets.

View hansogj's full-sized avatar

Hans Ole Gjerdrum hansogj

  • Systek AS
  • Nesodden, Norway
View GitHub Profile
@hansogj
hansogj / spond.laguttak.js
Created April 15, 2024 05:10
Henter ut spillere fra event
Array.from(document.querySelectorAll(".recipients-ul .display-name")).map(e => e.innerText).sort()
@hansogj
hansogj / palette.js
Last active October 23, 2023 12:03
Append color-palette and unicode symbols as examples to page
const html = (template = '') => document.createRange().createContextualFragment(template);
const body = document.querySelector('body');
const append = (values) => {
const palette = document.querySelector('#palette');
if (palette) palette.remove();
const container = html(`
<div id="palette" style="
min-height: 150px;
position: fixed;
@hansogj
hansogj / discogs.bulk.edit.js
Last active June 17, 2024 08:46
Edit all listed items in your discogs collection
const g = window || global;
const find = (selector, base = document) => Array.from(base.querySelectorAll(selector));
const timer = (ms) => new Promise((res) => setTimeout(res, ms));
const hideHeaderAndPrice = () =>
['thead', '.rating', '.collection-date-added-column', '.pricing', '.hide_mobile']
.flatMap((cn) => find(cn))
.forEach((e) => e.setAttribute('style', 'display: none'));
const GRADES = {
@hansogj
hansogj / npmu
Last active July 24, 2024 07:53 — forked from lebbe/npmu
Automatically perform npm updates and make it a pull request
#!/bin/bash -x
# Update all minor and patch versions of your own dependencies, and thereafter
# update all transitive dependencies. Use the JIRA-number as first and only argument.
# Put this, for instance, in /usr/bin and make it executable:
#
# sudo mv npmu /usr/bin/npmu
# sudo chmod 744 /usr/bin/npmu
function npm-clean-force-install() {
@hansogj
hansogj / mvncolor.sh
Last active December 17, 2015 18:49 — forked from katta/mvncolor.sh
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`