Skip to content

Instantly share code, notes, and snippets.

View ascenderx's full-sized avatar
🐃
Evangelizing FOSS

Jimmy Downer ascenderx

🐃
Evangelizing FOSS
View GitHub Profile
@ascenderx
ascenderx / Xubuntu-Install.sh
Created September 2, 2021 05:29
Xubuntu installation history & notes
# Flash the image onto a USB stick.
# - Replace `/path/to/xubuntu.iso` with the appropriate ISO image.
# - Replace `sdX` with the appropriate device node.
sudo dd if=/path/to/xubuntu.iso of=/dev/sdX conv=fdatasync status=progress bs=1M
# Boot into the USB stick and run the installer.
# You might need to boot into the PC's UEFI settings to do so.
# Make sure the install medium is botted in UEFI mode!
# On the new installation, run the following installers.
@ascenderx
ascenderx / RandomTunes.sh
Created September 2, 2021 05:28
Random tunes using bash & aplay
#!/usr/bin/env bash
# https://shkspr.mobi/blog/2016/04/generating-random-chiptunes-on-linux/
notes="-7,-6,-5,-2,0,3,5,6,7,10,12"
#notes="-7,-5,-3,0,2,5,7,9,12"
format=S32_LE
rate=24000
numChannels=2
@ascenderx
ascenderx / decodemidi.py
Created August 9, 2021 05:12
MIDI Decoder in Python
#!/usr/bin/env python3
# Python 3.9+
from enum import Enum
from io import BufferedReader
import sys
from typing import Dict, List, Tuple
EVENT_NOTE_OFF = 0x80
@ascenderx
ascenderx / cache_my_images.rb
Last active May 14, 2021 06:07
Get Yu-Gi-Oh! card images using Ruby
#!/usr/bin/env ruby
require "json"
require "fileutils"
my_cards = nil
source_folder = "json"
source_file_name = "#{source_folder}/my_cards.json"
File.open(source_file_name) { |file|
my_cards = JSON.parse(file.read)
@ascenderx
ascenderx / rainbow.ml
Created April 8, 2021 05:21
Simple rainbow in OCaml
#!/usr/bin/env ocaml
#load "graphics.cma"
#load "unix.cma"
open Graphics
open Printf
open Sys
open Unix
let display: string = getenv "DISPLAY"
@ascenderx
ascenderx / application.js
Created February 4, 2021 03:35
Canvas web app template
class CanvasApplication {
constructor(canvas) {
this._canvas = canvas;
this._graphics = canvas.getContext('2d');
this._timer = new AnimationTimer(
this._onTick.bind(this),
CanvasApplication._INTERVAL
);
this._inputHandler = new InputHandler();
}
@ascenderx
ascenderx / csscolors.js
Last active November 23, 2020 05:35
Simple color selector
// Cloned from: https://raw.githubusercontent.com/bahamas10/css-color-names/master/css-color-names.json
const CSS_COLORS = {
"aliceblue": "#f0f8ff",
"antiquewhite": "#faebd7",
"aqua": "#00ffff",
"aquamarine": "#7fffd4",
"azure": "#f0ffff",
"beige": "#f5f5dc",
"bisque": "#ffe4c4",
@ascenderx
ascenderx / Profile.ps1
Created June 17, 2020 04:27
PowerShell Profile Script
#$HOME\Documents\WindowsPowerShell\
$esc = [char]27
$red = "$esc[1;31m"
$green = "$esc[1;32m"
$yellow = "$esc[1;33m"
$blue = "$esc[1;34m"
$magenta = "$esc[1;35m"
$cyan = "$esc[1;36m"
$default = "$esc[1;39m"
@ascenderx
ascenderx / unicode-transformer.html
Last active May 23, 2020 01:50
Unicode homoglyph converter between Latin characters and letter-like symbols
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Unicode Text Transformer</title>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="theme-color" content="#000000"/>
<style>
* {
box-sizing: border-box;
@ascenderx
ascenderx / complex.js
Last active May 16, 2020 04:23
Complex function graphing in JS for Web
function degToRad(degrees) {
return Math.PI * degrees / 180.0;
}
function radToDeg(radians) {
return 180.0 * radians / Math.PI;
}
class Complex {
constructor(r, i) {