Skip to content

Instantly share code, notes, and snippets.

View Dark mode webpage.css
html{
filter: invert(1) hue-rotate(.5turn);
}
View Closure compiler node externs.js
// extending https://raw.githubusercontent.com/dcodeIO/node.js-closure-compiler-externs/master/process.js
// use together with
// @externs_url https://gist.githubusercontent.com/mathiasrw/a5696b591b439e55c052e9399028a274/raw/f878549e25646d0c9b2e5191b9c455ac2f662a0c/Closure%2520compiler%2520node%2520externs.js
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@mathiasrw
mathiasrw / npm-audit.sh
Created May 19, 2018
Get commands to fix npm audit
View npm-audit.sh
npm audit | ggrep -oP '(?<=# Run..).+(?=..to resolve)'
@mathiasrw
mathiasrw / hash160-to-base58.go
Created Jan 25, 2018
Convert hash160 hex strings to bitcoin bae58 address
View hash160-to-base58.go
package main
import (
"bufio"
"encoding/hex"
"fmt"
"github.com/btcsuite/btcutil/base58"
"log"
"os"
)
View nodeCLI.js
#!/usr/bin/env node
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(data) {
process.stdout.write(data);
});
@mathiasrw
mathiasrw / IotaSeed.sh
Created Dec 3, 2017
Generate IOTA seed
View IotaSeed.sh
env LC_CTYPE=C tr -dc "A-Z0-9" < /dev/urandom | fold -w 81 | head -n 1 > myIotaSeed.txt
View Screengrab from JIRA
jQuery('#details-module').hide();
jQuery('#viewissuesidebar').hide();
jQuery('.command-bar').hide();
jQuery('#page').replaceWith(jQuery('.content'));
jQuery('.issue-view').css('overflow-y','visible');
View linx find big files.sh
#Biggest files
du -hx * | sort -rh | head -20
#files over 50Mb
$ find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
#https://www.cyberciti.biz/faq/find-large-files-linux/
View url2md.js
/////////////////////////////////////
var got = require("got");
var toMarkdown = require("to-markdown")
var response = await got("http://www.whale.to/m/buchwald9.html");
console.log(toMarkdown(response.body))
View await + fetch url notes.js
https://runkit.com/docs/await
var got = URL => require("got")(URL, { json : true });
var response = await got("https://api.github.com/search/repositories?q=javascript&sort=stars&order=desc");
curl http://www.whale.to/b/silentweapon.html | htmlmd -p # virker ikke
htmlmd -i -a -p ost.html | sed -e 's/^##/#/g' > ost.md
You can’t perform that action at this time.