Skip to content

Instantly share code, notes, and snippets.

@media print {
h2, h3, h4, h5, h6 { break-after: avoid-page; }
img, svg, table, canvas { break-inside: avoid; }
a::after { content: " (" attr(href) ")"; }
}
@mathiasrw
mathiasrw / True Trello Printer
Last active February 27, 2024 21:21
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{
<?php
// Small hackable Mustache inspired templating
function alaMustache($template, array $values = []){
$pattern = '/{{(?<BOOLEAN>#|\^)\s*(?P<KEY>[\w\.-]+)\s*}}(?P<BLOCK>.*?)({{\/\s*\2\s*}})/ms';
$template = preg_replace_callback($pattern, function (array $matches) use ($values) {
if ($matches['BOOLEAN'] === '#') {
if (array_key_exists($matches['KEY'], $values) && !empty(trim($values[$matches['KEY']]))) {
return $matches['BLOCK'];
<?php
function spintax($text) {
$max = substr_count($text, '}');
$i = 0;
$currentPos = 0;
while ($currentPos < strlen($text) && ($endPos = strpos($text, '}', $currentPos)) !== false) {
if ($i++ > $max) break;
Title title Note Heading Depth
Manifest
_Anti Mediocracy Manifesto for Software Development_
0

[TITLE]

One

@mathiasrw
mathiasrw / hash160-to-base58.go
Created January 25, 2018 09:48
Convert hash160 hex strings to bitcoin bae58 address
package main
import (
"bufio"
"encoding/hex"
"fmt"
"github.com/btcsuite/btcutil/base58"
"log"
"os"
)
html{
filter: invert(1) hue-rotate(.5turn);
}
# First thing when spinning up a newly installed debian
# bash <(curl -s https://URLURLURLURLRULRULRULURL)
echo set syntax=on >> .vimrc
echo set nowrap >> .vimrc
sudo apt-get update
sudo apt-get -y upgrade
// 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 19:02
Get commands to fix npm audit
npm audit | ggrep -oP '(?<=# Run..).+(?=..to resolve)'