Skip to content

Instantly share code, notes, and snippets.

@bikubi
bikubi / run.sh
Created August 1, 2018 04:38
Correct Horse Battery: The Band
#!/bin/bash
# see http://cyfta.com/band-name-y-3-word-combos-with-exactly-1-youtube-hit/ for what this is all about.
key="YOURYOUTUBEAPIKEY"
mkdir -v q
for s in {1..1000}; do
# generate "passwords"
@bikubi
bikubi / wfmugpio.py
Last active March 26, 2021 12:42
Control a web radio stream on a Raspi with GPIO, a button and an LED.
#!/usr/bin/env python
import subprocess as sp
import RPi.GPIO as g
import time
import os
# see http://cyfta.com/?p=8480
# & listen to WFMU! http://wfmu.org
@bikubi
bikubi / README.md
Created March 1, 2019 12:39
Simple Purgecss setup for Roots Sage WordPress starter theme

Why

  1. Sage doesn't come with Purgecss (or uncss, etc.)
  2. Say, we use Bulma -- suddenly dist/main.css grows by 400K!
  3. Let's purge it!
  4. Oh dang, we need to whitelist /\.wp-/, /\.post-type/, /myfancylightbox/...
  5. Wait we are whitelisting pretty much everything from /resource/assets/styles!
  6. Isn't there an option to purge /node_modules/**/* only?
  7. Nope.
  8. purgecss start ignore, strategically placed, to the rescue!
@bikubi
bikubi / wp-blockgallery-fixsizes.php
Created March 13, 2019 11:37
hack to inject better sizes attribute into WordPress Gutenberg Gallery Block
<?php
/* Not really recommended, very dangerous. Will change entities.
* Adjust the xpath query & sizes to your needs.
*/
add_filter('the_content', function ($content) {
try {
$preamble = '<?xml encoding="utf-8" ? >';
$doc = new DOMDocument();
$doc->preserveWhiteSpace = true;
@bikubi
bikubi / quasar-variables-scss.md
Last active April 10, 2019 12:51
Use Quasar variables in SCSS stylesheets (incomplete)

Quasar supports SCSS but the style variables won't be available.
Here's a possible workaround -- incomplete & untested, since I gave up, went ahead and used stylus. (This is guide is primarily directed at future me, should this become more compelling in the future.)

Install stylus-converter

yarn add --dev stylus-converter
@bikubi
bikubi / iptables-nat.service
Created April 11, 2020 11:43
Very simple iptables NAT systemd service
# Very simplistic, use at your own risk. I am using this on Raspbian.
#
# put me into /etc/systemd/system
# systemctl start iptables-nat
# systemctl stop iptables-nat
# systemctl enable iptables-nat
#
# see: https://wiki.archlinux.org/index.php/Internet_sharing
# adapted from: https://github.com/gronke/systemd-iptables/blob/master/etc/systemd/system/iptables.service