Skip to content

Instantly share code, notes, and snippets.

View bobbicodes's full-sized avatar
💭
Moved to bobbicodes on Codeberg

Bobbi Towers bobbicodes

💭
Moved to bobbicodes on Codeberg
View GitHub Profile
@bobbicodes
bobbicodes / insertion_sort.cljs
Last active June 20, 2021 04:43
Insertion sort toy
(ns insertion-sort
(:require [reagent.core :as r]))
(defn input [type label value on-change]
[:label label
[:input
{:style {:width 40}
:type type
:value value
:on-change on-change}]])
@bobbicodes
bobbicodes / scat
Created December 19, 2020 02:38
Simulate typing text in console from file!
#!/bin/bash
clear
sleep 1
cat $1 | while IFS='' read -r line || [[ -n "$line" ]]; do
echo -n "$line" | pv -qL 10
sleep .5
echo ""
sleep .5
done
@bobbicodes
bobbicodes / rand-sid.ps1
Last active November 25, 2020 23:48
Play random SID track from directory
$file = Get-ChildItem -Path .\sid-songs\ | Get-Random
java --module-path . --add-modules javafx.controls,javafx.web,javafx.fxml --add-opens java.base/java.io=org.apache.tomcat.embed.core -jar .\jsidplay2_console-4.1.jar sid-songs\$file
@bobbicodes
bobbicodes / abstract.md
Created October 13, 2020 03:54
MECCA Presentation - abstract, outline and bio

MECCA - The Music Education, Composition, Creation Application

This is a music talk, and includes audio performance elements.

Abstract

A multitude of tools exist for creating and learning music: Theory trainers, DAWs (digital audio workstations), notation editors, and virtual instruments. Rarely though does one support all of these, and even more rarely was it designed with their coordination in mind. We are establishing a dichotomy between our tools that perpetuates an illusion that the expression of the craft and the processes of acquiring its related knowledge and skills are somehow disconnected, and removing the sense of exploration that is so essential for authentic perfomance. What if we were to design a set of unified tools emerging from this spark of awareness, that these combined features could be transformatively synergistic when implemented together, as a music editor optimized for both education and performance?

After establishing its roots as a humble Bash script for generating NES Chi

@bobbicodes
bobbicodes / kill-tabs.md
Last active March 30, 2020 10:23
Operation: Kill the tabs

I have too many browser tabs open and they all seem important. So I'm going to systematically take them out until I close the browser itself.

Theoretically, this may never happen. Most of them represent things that need to be done, many of which are ongoing projects. It's difficult to imagine somehow "finishing" everything. But I'm curious what kind of progress this approach might lead to. Notes on my progress will be recorded here.

March 30:

Beginning now. I currently have 22 tabs. Wish me luck.

Update:

@bobbicodes
bobbicodes / rc.lua
Last active January 12, 2021 02:18
Awesome Window Manager config
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
@bobbicodes
bobbicodes / init.vim
Created March 14, 2020 11:34
Neovim config
" Specify a directory for plugins.
call plug#begin('~/.config/nvim/plugged')
" Specify your required plugins here.
Plug 'liuchengxu/vim-better-default'
Plug 'easymotion/vim-easymotion'
Plug 'guns/vim-sexp'
Plug 'tpope/vim-sexp-mappings-for-regular-people'
Plug 'Shougo/deoplete.nvim'
Plug 'ncm2/float-preview.nvim'
@bobbicodes
bobbicodes / play.cljs
Last active March 30, 2020 22:29
Play audio files one after the other. Shows how to use promises
(defn play [audio]
(.play audio)
(js/Promise.
(fn [resolve reject]
(.addEventListener audio "ended" resolve))))
(let [s1 (.createElement js/document "audio")
s2 (.createElement js/document "audio")
s3 (.createElement js/document "audio")]
(set! (.-src s1) "ji.mp3")
(set! (.-src s2) "byo.mp3")
@bobbicodes
bobbicodes / gist:799df2c1c26fda47972bf66d1d4e30e1
Created January 24, 2020 12:49
shell out to vim from repl
there's a one liner I've got somewhere, I can even exec vim, edit a file, then exit back to a repl
2:15
the gotcha is you have to make the shell (which is reading form the same terminal) wait for the process to exit
(defn foo []
;; with this code you can access all your svg elements in JS
[:object
{:data "/file.svg"
:id "file"
:width ...
:height ...}
;; make sure you access the elements only when the svg has fully loaded
:onLoad (fn []
(let [svg-content (.-contentDocument