Skip to content

Instantly share code, notes, and snippets.

@blippy
blippy / play.c
Last active December 13, 2023 22:37
Playing hard-coded audio on an ESP32 via DAC
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#include <driver/dac.h>
// The 8-bit values in our sound sample
#include "track.h"
@blippy
blippy / images.ipynb
Created February 28, 2016 11:06
Reducing opacity of an image using python an PIL
x
@blippy
blippy / scr.cob
Created October 30, 2016 16:33
Creating a COBOL screen
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-ATX.
OBJECT-COMPUTER. IBM-ATX.
SPECIAL-NAMES.
@blippy
blippy / voicer.ino
Created June 26, 2019 20:39
Streaming audio on an ESP32 with a blinkt
#include <Arduino.h>
#include <WiFi.h>
#include <driver/dac.h>
const int dataPin = 4; // Blinkt pin 16
const int clockPin = 5; // blinkt pin 18
const int numLEDs = 8;
uint8_t pixels[numLEDs * 3];
void spi_out(uint8_t n) {
@blippy
blippy / slurp.cc
Last active March 1, 2021 21:06
Slurp a file in C++
#include <fstream>
#include <sstream>
std::string slurp(const char *filename)
{
std::ifstream in;
in.open(filename, std::ifstream::in | std::ifstream::binary);
std::stringstream sstr;
sstr << in.rdbuf();
in.close();
@blippy
blippy / cinelerra-dependencies.sh
Last active December 6, 2020 08:21
Compiling cinelerra-cv on Ubuntu 18.04
#!/usr/bin/env bash
# Setup for Ubuntu 18.08, 18.10
# standard'ish GNU tools
sudo apt-get install libtool # stops configure.ac AC_ENABLE_SHARED, ... probs
# Other items seems required by ubuntu 17.10
sudo apt-get install nasm
sudo apt install libfontconfig1-dev intltool libxft-dev
@blippy
blippy / pd.pl6
Created November 25, 2020 15:20
Partition dump MBR
#!/usr/bin/env perl6
# Reference:
# https://wiki.osdev.org/Partition_Table
my %ids = 0x00 => "Empty", 0x0b => "W95 FAT32", 0x0c => "W95 FAT32 (LBA)",
0x82 => "Linux swap", 0x83 => "Linux", 0x93 => "Amoeba";
sub MAIN($filename) {
say "Disk: $filename";
@blippy
blippy / dillo.desktop
Created December 3, 2015 11:47
Example .desktop file
# Desktop entry for dillo.
# System wide install as /usr/share/applications, or /usr/local/share/applications
# Private install as $HOME/.local/share/applications
# See http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html
# See http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
[Desktop Entry]
Version=3.0.5
Type=Application
Name=Dillo web browser
GenericName=Web Browser
@blippy
blippy / elang.p6
Created July 2, 2020 10:26
Creating a templating system in raku
grammar G {
token TOP { <atom>* }
token atom { IFX { print "\n.. GOT IFX..\n"; }
| IF {print "\n--GOT IF--\n"; }
| . { print $/; }
}
}
my $str = "heIFllIFXo\n";
@blippy
blippy / mywifi.lua
Created June 16, 2020 14:15
Crude demo of using wifi on ESP8266 Lua
-----------------------------------------------
--- Set Variables ---
-----------------------------------------------
--- WIFI CONFIGURATION ---
WIFI_SSID = ""
WIFI_PASSWORD = ""
WIFI_SIGNAL_MODE = wifi.PHYMODE_N
--- IP CONFIG (Leave blank to use DHCP) ---
ESP8266_IP="192.168.0.30"