Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ ${#@} -gt 1 ]; then
TITLE="$1"
BODY="${@:2}"
else
TITLE=""
BODY="$@"
fi
token="$(cat ~/.pushtoken)"
curl \
@EllieTheYeen
EllieTheYeen / envtest.py
Last active October 26, 2024 08:15
Testgist
#!/usr/bin/python3
import os
os.environ["POST"] = 'this is some data here yes probably long and all that meow soft mew'
os.environ["MOST"] = "mew mew mew mew mew commit message"
os.system("./testenv.sh")
@EllieTheYeen
EllieTheYeen / 7segtest.py
Created June 1, 2024 01:35
7 Segment silly test
glyphs = {
"0": 0b11111100,
"1": 0b01100000,
"2": 0b11011010,
"3": 0b11110010,
"4": 0b01100110,
"5": 0b10110110,
"6": 0b10111110,
"7": 0b11100000,
"8": 0b11111110,
@EllieTheYeen
EllieTheYeen / ringbuffertest.py
Created May 29, 2024 18:19
Python ring buffer test
class RingBuffer:
full = False
readpos = 0
writepos = 0
def __init__(self, size=8):
self.size = size
self.buf = [0] * size
def take(self):
if self.readpos == self.writepos:
if self.full:
// Settings
//#define DEBUG
#define MAXSTR 128
// Morse logic
class RingBuffer {
private:
size_t size;
unsigned char readpos;
@EllieTheYeen
EllieTheYeen / structportgpio.ino
Created May 20, 2024 03:03
Arduino port manipulation using struct
struct PBS {
bool D8 : 1;
bool D9 : 1;
bool D10 : 1;
bool D11 : 1;
bool D12 : 1;
bool D13 : 1;
bool DONOTUSE1 : 1;
bool DONOTUSE2 : 1;
@EllieTheYeen
EllieTheYeen / mulie-shidle.cpp
Last active June 1, 2024 00:51
This is just some test thing for the Arduino multi-function shield or as it funnily is spelled on the board "Mulie-function shidle" where it parses numbers in CSV lines and turns on the 7 segment display and LEDs plus some debouncing that does not work that well
#define BUZ 3
#define KNB A0
#define BT1 A1
#define BT2 A2
#define BT3 A3
#define LD1 10
#define LD2 11
#define LD3 12
#define LD4 13
#define DAT 8
<?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: text/html; charset=utf8');
?>
<html>
<body>
<head>
<title>Smol</title>
<style>
html {background-color: #000000; color: #ffffff;}