Skip to content

Instantly share code, notes, and snippets.

@bbengfort
bbengfort / zipr.py
Last active December 5, 2021 01:34
Dealing with Zip archives and json data in Python
#!/usr/bin/env python3
import os
import json
import random
import zipfile
config = {
"color": "red",
"amount": 42.24,
@tuffacton
tuffacton / streamlit_colab.ipynb
Last active March 7, 2024 05:47
Colaboratory Notebook that hosts a streamlit app and creates an ngrok https tunnel for access.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bellbind
bellbind / index.html
Last active June 17, 2025 23:35
[chrome][android] BarcodeDetector example
<!doctype html>
<html>
<head>
<script type="module">
// WICG Shape Detection API
// - https://wicg.github.io/shape-detection-api/
try {
const start = document.getElementById("start");
const video = document.getElementById("video");
const result = document.getElementById("result");
@tomhicks
tomhicks / plink-plonk.js
Last active May 15, 2025 13:25
Listen to your web pages
{
"basics":{
"name":"Michael Salaverry",
"label":"Senior Fullstack Web Developer",
"website":"https://github.com/barakplasma",
"summary":"Test Driven Developer. Passionate about automation. I love working on difficult technical problems that involve learning new skills and delivering great experiences and solutions to my customers.",
"profiles":[
{
"network":"Github",
"username":"barakplasma",
@parsley42
parsley42 / README.md
Last active October 19, 2024 17:16
Chromebook ssh-agent setup

Setting up ssh-agent in Linux/Crostini on Chromebook

  • Create your user systemd directory:
$ mkdir -p .config/systemd/user
  • Edit the unit file .config/systemd/user/ssh-agent.service:
[Unit]
Description=SSH key agent
@anatolebeuzon
anatolebeuzon / 20auto-upgrades
Last active March 24, 2024 08:21
Unattended-upgrades config for Raspberry Pi running Raspbian
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "3";
APT::Periodic::Verbose "1";
APT::Periodic::Unattended-Upgrade "1";
const express = require('express');
const { html, Component } = require('htm/preact');
const renderToString = require('preact-render-to-string');
class App extends Component {
render(props) {
return html`
<div class="app">
<h1>This is an app</h1>
<p>Current server time: ${new Date + ''}</p>
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 18, 2025 19:09
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@devloco
devloco / download-pdf.js
Last active December 2, 2024 04:14
Download a PDF via POST with Fetch API
let fnGetFileNameFromContentDispostionHeader = function (header) {
let contentDispostion = header.split(';');
const fileNameToken = `filename*=UTF-8''`;
let fileName = 'downloaded.pdf';
for (let thisValue of contentDispostion) {
if (thisValue.trim().indexOf(fileNameToken) === 0) {
fileName = decodeURIComponent(thisValue.trim().replace(fileNameToken, ''));
break;
}