Skip to content

Instantly share code, notes, and snippets.

View johanbove's full-sized avatar
💭
Semper meliorem facio

Johan Bové johanbove

💭
Semper meliorem facio
View GitHub Profile
@johanbove
johanbove / npminstall.sh
Created January 31, 2023 15:47
This script will attempt to add packages to npm cache after they returned with the ECONN error
#!/bin/bash
echo "This script will attempt to add packages that return ECONN on the first try automatically."
logLevel="info"
echo "Setting config to loglevel: $logLevel"
npm config set loglevel=$logLevel
parse () {
@johanbove
johanbove / gitlab-bookmarklet.js
Last active May 9, 2022 12:59
Gitlab add issue from line number bookmarklet
javascript:(function()%7Btitle%3D""%3Bdescription%3Dwindow.prompt(%27Copy the url to the code line%27,location.href)%3Btarget%3D%27{---REPLACETHISWITHPROJECTURL---}/-/issues/new%27%3Blocation.href%3Dtarget%2B%27%3Fissue%5Btitle%5D%3D%27%2BencodeURIComponent(title)%2B%27%26issue%5Bdescription%5D%3D%27%2BencodeURIComponent(description)%3B%7D)()%3B
@johanbove
johanbove / itemstore-swagger.json
Last active March 28, 2022 15:13
Swagger specs for an item store - totally based on the petstore example
{
"swagger": "2.0",
"info": {
"description": "A concept for a system for keeping track of inventory and items needed; can be used for managing items used in donations",
"version": "0.1.0",
"title": "Item Donations",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "hello@johanbove.info"
},
@johanbove
johanbove / curl-to-ipfs.bat
Last active March 22, 2022 06:27
Saves the JSON files to IPFS
:: http://steve-jansen.github.io/guides/windows-batch-scripting/part-2-variables.html
:: Saves the JSON files to IPFS
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
:: script global variables
SET me=%~n0
SET parent=%~dp0
SET folder=export
SET event=https://ukraine.bellingcat.com/ukraine-server/api/ukraine
@johanbove
johanbove / check_todo.py
Created January 27, 2022 15:32
Todo.txt file reporter
# Analyses the "Todo.txt" file and returns a report
# More about the Todo.txt format: http://todotxt.org/
#
# Needs: python3
#
# Todo:
# - Check out the library: https://github.com/vonshednob/pytodotxt
#
# COPYLEFT - NO WARRANTIES! - I'M A NOOB LICENSE
@johanbove
johanbove / ipfs-helloworld.cmd
Created July 12, 2021 21:08
IPFS command-line quick start on Windows cmd
$ for /f %n in ('whoami') do set name=%n
$ for /f %f in ('echo "I <3 IPFS -%name%" ^| ipfs add -q') do set hash=%f
$ ipfs cat %hash%
@johanbove
johanbove / twtxt.html
Last active June 25, 2021 10:39
A one file Twtxt txt to HTML parser using markdown
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="none" />
<title>Twttxt</title>
<style>
body {
@johanbove
johanbove / web-monetization-snippet.html
Last active June 14, 2021 22:11
Web Monetization snippet
<div class="row">
<div class="col-md-12">
<!-- Testing Web Monetization -->
<div id="web-monetization" style="text-align:center;margin:2em;">This site is web monetization enabled. <a href="https://webmonetization.org/" rel="noopener noreferrer" style="text-decoration:underline">Learn more about Web Monetization</a>.</p></div>
<script>
const adCode = '<p>My site is <a href="https://webmonetization.org/" rel="noopener noreferrer">web monetization</a> enabled. Please consider supporting me through <a href="https://coil.com" rel="noopener noreferrer" style="text-decoration:underline">Coil.com</a>.</p>'
function showAds () {
document.getElementById('web-monetization').innerHTML = adCode
}
@johanbove
johanbove / solokey-bash.log
Last active March 21, 2021 14:33
How to upgrade a SoloKey firmware
// See https://github.com/conorpp/solo-dicekeys/releases/tag/5.0.0
$ solo version
0.0.27
$ python3 --version
Python 3.9.0
$ solo ls
:: Solos
208B31985653: Solo 4.1.1
~ $ pip3 install --upgrade solo-python
Requirement already satisfied: solo-python in /usr/local/lib/python3.9/site-packages (0.0.27)
@johanbove
johanbove / coilMetaTagRemover
Last active February 9, 2021 21:11
You have a coil.com web monitization tag in the head of your site and you don't want to send yourself money, use this TamperMonkey script
// ==UserScript==
// @name coilMetaTagRemover
// @namespace http://johanbove.info/
// @version 2.0
// @description Removes my own Coil meta tag
// @author Johan Bové
// @include /johanbove.info
// @run-at document-body
// ==/UserScript==