Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar

iomonad iomonad

  • 20:08 (UTC +03:00)
View GitHub Profile
@iomonad
iomonad / weechat-light-terminal.conf
Created May 2, 2022 08:56 — forked from TauPan/weechat-light-terminal.conf
All my colour settings for a light (not white) terminal in weechat. I simply filtered my fset buffer with "color"
# Comma separated list of channels
/set colorize_nicks.look.blacklist_channels ""
# Comma separated list of nicks
/set colorize_nicks.look.blacklist_nicks "so,root"
# Whether to colorize input
/set colorize_nicks.look.colorize_input off
# If off, then use lazy matching instead
@iomonad
iomonad / tb_303.scd
Created April 1, 2022 12:04
TB303 on Supercollider
(
SynthDef(\impulseSync, {
|rate=1, bpm=135, barLengthInBeats=4, resetLength=1|
var reso = 96;
var clockFreqFull = bpm / 60 / barLengthInBeats * rate;
var clockFreq = clockFreqFull / resetLength;
var impSubDivs = Impulse.ar(clockFreqFull * barLengthInBeats * reso, 0);
var imp = PulseDivider.ar(impSubDivs, (barLengthInBeats * reso * resetLength).floor, barLengthInBeats * reso);
var clockPos = Phasor.ar(imp, clockFreqFull / SampleRate.ir, 0, 1, 0); var barCounter = PulseCount.ar(imp);
Out.ar(30, barCounter);
@iomonad
iomonad / jq-cheetsheet.md
Created March 24, 2022 13:05 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@iomonad
iomonad / hardware.s
Created December 1, 2021 09:05
Nintendo Gameboy Hardware Definition
;*
;* Gameboy Hardware definitions
;*
;* Based on Jones' hardware.inc
;* And based on Carsten Sorensen's ideas.
;*
;* Rev 1.1 - 15-Jul-97 : Added define check
;* Rev 1.2 - 18-Jul-97 : Added revision check macro
;* Rev 1.3 - 19-Jul-97 : Modified for RGBASM V1.05
;* Rev 1.4 - 27-Jul-97 : Modified for new subroutine prefixes
@iomonad
iomonad / declaim.lisp
Created November 25, 2021 14:12
Declaimed lisp var
(defvar *foo*) ; a global variable *FOO*
(declaim (type (integer 0 10) *foo*)) ; type should be integer between range
(setf *foo* 30) ; kaboom
@iomonad
iomonad / README.md
Created November 4, 2021 22:11 — forked from bodokaiser/README.md
Guide How-To use Device Tree Overlays on Archlinux.

Device Tree Overlays on Archlinux

Dependencies

base-devel

You require a working archlinuxarm operarting system and the development tools:

$ pacman -S base-devel
@iomonad
iomonad / deps.edn
Created September 26, 2021 10:52 — forked from souenzzo/deps.edn
Clojure version of "java quickstart" from gsheets. https://developers.google.com/sheets/api/quickstart/java
;; run with
;; clj -Sdeps '{:deps {gdocs {:git/url "https://gist.github.com/souenzzo/df540002607b15378f8014237e499fdd" :sha "fee00617c75fc24c74931aa4200f74666c5b66b6"}}}' -m gdocs
{:paths ["."]
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
com.google.api-client/google-api-client {:mvn/version "1.28.0"}
com.google.oauth-client/google-oauth-client-jetty {:mvn/version "1.28.0"}
com.google.apis/google-api-services-sheets {:mvn/version "v4-rev566-1.25.0"}}}

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@iomonad
iomonad / query.edn
Last active June 11, 2021 15:48
crux api query
(def results
(crux/q (crux-db) '{:find [discount-key company flow supplier-id
warehouse-id manufacturer-id discount
discount-type ?discount],
:where [[?discount :discount/company company]
[?discount :discount/flow flow]
[?discount :discount/supplier-id supplier-id]
[?discount :discount/warehouse-id warehouse-id]
[?discount :discount/discount discount]
[?discount :discount/manufacturer-id manufacturer-id]
; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.