Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@kzu
kzu / profiles.json
Last active July 22, 2020 06:26
Windows Terminal settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{63661ee7-c8c4-434e-8579-f6112c77101f}",
"requestedTheme": "dark",
"profiles":
{
@katef
katef / life-utf8.c
Last active September 8, 2024 05:59
XBM to UTF-8 braille image things
/*
* John Conway's Game of Life.
*
* This is written for POSIX, using Curses. Resizing of the terminal is not
* supported.
*
* By convention in this program, x is the horizontal coordinate and y is
* vertical. There correspond to the width and height respectively.
* The current generation number is illustrated when show_generation is set.
*
@tfcporciuncula
tfcporciuncula / PdfDownloader.kt
Last active September 8, 2022 06:41
PdfDownloader.kt
class PdfDownloader @Inject constructor(
private val context: Context,
private val yourApi: YourApi
) {
private class DownloadException(message: String, cause: Throwable? = null) : RuntimeException(message, cause)
suspend fun download(url: String, fileName: String): String = withContext(Dispatchers.IO) {
val file = createFile(fileName)
@tfcporciuncula
tfcporciuncula / PdfAdapter.kt
Last active March 19, 2024 11:50
PDF rendering the easy way
class PdfAdapter(
// this would come from the ViewModel so we don't need to recreate it on config change
// and the VM can close it within onCleared()
private val renderer: PdfRenderer,
// this would come from the Activity/Fragment based on the display metrics
private val pageWidth: Int
) : RecyclerView.Adapter<PdfAdapter.ViewHolder>() {
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
@nileshtrivedi
nileshtrivedi / home-server.md
Last active September 9, 2026 23:50
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@anotherlab
anotherlab / adb-32.png
Last active September 18, 2024 21:46
Quick little PowerShell script to add the ADB tools to the path
adb-32.png
@gabrielsson
gabrielsson / minecraft-on-raspberry-pi.md
Last active June 12, 2026 06:19
Minecraft on Raspberry Pi cluster with metrics

alt

Minecraft on Raspberry Pi cluster with metrics

Ever wanted to put your Rapsberry Pi cluster to great use? Our team is working remotely, so we started to play Minecraft. I decided I would host the Minecraft server on my Raspberry Pi cluster. This gist will guide you through the steps I took to get a k3s cluster up with k3sup and later installed Minecraft as well as metrics exporter and Prometheus Operator

Why?

Quoniam Possumus - Because we can

You'll need

@mkieres
mkieres / xamarin-forms-android-aab-yaml-pipeline.yaml
Last active February 10, 2020 12:25
Create Xamarin.Forms Android App Bundle (aab) and release it to Google Play Store with DevOps YAML
trigger:
branches:
include:
# Your CI branch that the build should be triggered for
- vNext
stages:
- stage: Build
pool:
vmImage: 'windows-latest'