Skip to content

Instantly share code, notes, and snippets.

@wd5gnr
wd5gnr / pic_16f886-2.log
Last active August 29, 2015 14:00
Pastebin for MINIPro
BULK_OUT(0.1):03639100010000000028000000400000c00fe00f40000000000000000000000000000000000000000000000000000000 # 0.0000000000000000
BULK_OUT(0.1):fe63910001 # 0.0020170211791992
BULK_IN(0.1): 0000bfbfbfbfbfbfbf00bfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbf # 0.1331801414489746
BULK_OUT(0.1):0563910001000000 # 0.0018589496612549
BULK_IN(0.1): 040262203e0202 # 0.0306379795074463
BULK_OUT(0.1):fe63910001 # 0.0083658695220947
BULK_IN(0.1): 0000bfbfbfbfbfbfbf00bfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbfbf # 0.0021290779113770
BULK_OUT(0.1):04639100 # 0.0017690658569336
BULK_OUT(0.1):03639100010000000028000000400000c00fe00f40000000000000000000000000000000000000000000000000000000 # 0.1330490112304688
BULK_OUT(0.1):fe63910001 # 0.0020220279693604
@wd5gnr
wd5gnr / hidetab.css
Created July 28, 2020 15:44
Vivaldi Configurations
/*Vertical tab bar auto-hide*/
#tabs-container{
width: 5px !important;
}
#tabs-container:hover{
width: 220px !important;
}
/*Tab bar is an overlay instead of resizing the page*/
#main .inner {
position: relative;
@wd5gnr
wd5gnr / baloo-nice
Created November 28, 2020 04:22
A script to move baloo to a cgroup where you can limit its disk usage!
#!/bin/bash
#baloo-nice by Al Williams
RLIMIT=1048576 # bps limit (read)
WLIMIT=1048576 # bps limit (write)
DEVICES="8 252 253 259"
SEARCH=baloo
if [ ! -d /sys/fs/cgroup/blkio/baloo ]
then
@wd5gnr
wd5gnr / main.c
Created April 25, 2021 19:43
Simple SQLite example
#include <sqlite3.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
sqlite3 *db;
sqlite3_stmt *sql;
int rv;
rv=sqlite3_open("parts.db",&db);
@wd5gnr
wd5gnr / hilo.sh
Last active March 29, 2023 20:02
A simple hilo game using Gum (https://github.com/charmbracelet/gum)
#!/bin/bash
clear
# init colors
FG="#00ffff"
BFG="#00ff00"
# if you wonder why true is in there https://www.shellcheck.net/wiki/SC2015
gum confirm --default --affirmative="Play now" --negative="Dump source first" --timeout=10s "Would you like to view the source code before playing?" && true || ( gum format -t code <"$0" )
# get initial info
gum style --foreground "$FG" --border-foreground "$BFG" --border double --align center --width 64 --margin "1 2" --padding "2 4" \
@wd5gnr
wd5gnr / Program.cpp
Created May 5, 2023 21:29
1802 Literate Assembler Examples
// Simple 1802 Literate Program
#include "lit1802.h"
#define ON 1
#define OFF 0
#define DELAYPC 9 // delay subroutine
#define DELAYR 8 // delay count register
#define MAINPC 3 // Main routine PC
@wd5gnr
wd5gnr / test.py
Created October 25, 2023 19:44
Sample Python asyncio Test
import asyncio
import testb
state={'done': 0 }
async def taskA():
global done
print("A")
await asyncio.sleep(5)
print("A'")
@wd5gnr
wd5gnr / badpython.py
Created November 7, 2023 22:47
Issue with Python Class Variables
# This is what's wrong with class variables in Python
# and yes, properties work (don't work) the same way
# This is a stupid but clean example where class A
# has a class variable x. It also has direct subclasses
# B and C
# Then there is a subclass of C named D
# None of them should have an x variable, but they all will get one
class A:
@wd5gnr
wd5gnr / trigwave.ino
Created December 13, 2023 20:52
Trigger Demo Waveforms
// For best results use Normal trigger mode
#define CLOCK 6 // ch1
#define DATA 15 // ch2
#define RS232_OUT 0 // D0 -- by default; this symbol is not used
#define RS232_IN 1 // not really used
#define ANALOG_CLEAR 21 // Discharge analog capacitor fast
@wd5gnr
wd5gnr / baloo-nice
Created June 1, 2022 14:43
A script to move baloo to a cgroup to limit both memory and disk I/O
#!/bin/bash
#baloo-nice by Al Williams
if [ "$1" == "fast" ]
then
RLIMIT=100048576 # bps limit (read)
WLIMIT=100048576 # bps limit (write)
else
RLIMIT=548576 # bps limit (read)
WLIMIT=548576 # bps limit (write)