Skip to content

Instantly share code, notes, and snippets.

View DougThompson1976's full-sized avatar

Doug Thompson DougThompson1976

  • 17:34 (UTC -05:00)
View GitHub Profile

jq Cheat Sheet

jq is useful utility, but I use it infrequently and each time I have to check what was the filters syntax. This cheat sheet helps we to recall what is the expression that I need. Hopefully it would help others too. For full guide refer to the official jq manual.

All the jq you (usually) need

Given the following JSON:

@DougThompson1976
DougThompson1976 / jq-cheetsheet.md
Created February 27, 2025 16:37 — 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

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@DougThompson1976
DougThompson1976 / README.md
Created May 31, 2022 04:04 — forked from manuelbl/README.md
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@DougThompson1976
DougThompson1976 / 8NotePolyphonicSetup.rb
Created May 31, 2022 02:08 — forked from rbnpi/8NotePolyphonicSetup.rb
8 note polyphonic gated synths for Sonic Pi 3. Allows keyboard input with notes of any length. Requires SP3, and powerful computer at present: not Raspberry Pi. Article at https://rbnrpi.wordpress.com/2017/08/06/8-note-polyphonic-gated-synth-for-sonic-pi-3/ video at https://youtu.be/gD-50-_dgxg
#8 note polyphony gated synth setup program
#by Robin Newman, August 2017
#Set initial states for polyphonic synth
set :vm1,0
set :vm2,0
set :vm3,0
set :vm4,0
set :vm5,0
set :vm6,0
set :vm7,0
@DougThompson1976
DougThompson1976 / gist:482c712565f8ec7f7b84cf63c02ba112
Created November 2, 2017 19:24 — forked from mbutz/gist:2ea7cdd19648c380a721
Sonic Pi Sequencer - Proof of concept
# Sonic Pi Sequencer (beta)
# Not yet music, but a proof of concept and part of a toolbox to
# create pattern based music
# Rather than think about durations and time distances I'd like to think of
# bars and patterns. Something like that:
# | 16 | 1 | e | u | e | 2 | e | u | e | 3 | e | u | e | 4 | e | u | e |
# |----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---|
# | Bass | x | | x | x | | | x | | | x | | | | | x | |
# Sonic Pi Sequencer (v2)
# Simplified notation of synth lines, can now play chords
use_debug false
set_volume! 1
use_bpm 120 # beat = quarter note
# TODO
# Make 'play_rhythm_bar' to work with an array of samples like 'play_melody_bar'
# AFX Song Sketch
use_debug false
set_volume! 1
use_bpm 128 # beat = quarter note
# TODO
# Shaker
# Rework the tune synth
# Break at 19
@DougThompson1976
DougThompson1976 / AFX, 1.7, base
Created November 2, 2017 19:23 — forked from mbutz/AFX, 1.7, base
Base of AFX 1.7 - helper functions, patterns and song modules
# AFX 1.7, prepare the tune
use_debug false
set_volume! 1
use_bpm 128
load_samples [:loop_compus, :elec_wood, :drum_bass_hard, :drum_snare_hard, :drum_snare_hard, :drum_cymbal_closed, :elec_snare, :drum_tom_hi_soft]
# Helper Functions
@DougThompson1976
DougThompson1976 / AFX, 1.7, tune
Created November 2, 2017 19:23 — forked from mbutz/ AFX, 1.7, tune
Tune of AFX 1.7 - the actual tune
# AFX 1.7, play the tune
use_debug false
set_volume! 1
use_bpm 128
puts "01"
mod_shaker
mod_bordun
sleep 16