Skip to content

Instantly share code, notes, and snippets.

View iomonad's full-sized avatar
🍋
λ

iomonad iomonad

🍋
λ
  • 15:01 (UTC +03:00)
View GitHub Profile
@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.
// 2020-02-18 17:23 -- irssi backlock
<pil> Et bah alors
<pil> On reconnaît bien les goûts des teufeurs orientait par le speed et les autres trucs de synthèses..
<pil> Tant que ça n'est pas du hardfloor à base de sample de fatal bazooka ils ne sont pas en trance..
<pil> Huuuu Fait Pété !! Hardcore!!!
<pil> je les imagine dire ça sur le dancefloor..
<pil> Quel dommage pour La Peste et d'autres Mathématiciens de la Musique
<pil> Il suffirait pourtant qu'ils se laissent aller à écouter de la musique électronique pas seulement en rave pour apprécier cette performance..
<pil> Ces pauvres gens n'ont jamais du écouter du Praxis, Reverse, Explore Toi, Cavage, Planet Mu , Schematic, Warp etc.
@iomonad
iomonad / 00_destructuring.md
Created February 21, 2021 19:26 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences