Skip to content

Instantly share code, notes, and snippets.

View govorox's full-sized avatar

govorox

  • Interface Devices, Honeybank Studios
  • UK
View GitHub Profile
@pojntfx
pojntfx / main.sh
Last active May 18, 2024 07:53
Bluesky/AT Protocol: cURL API Interaction Cheatsheet
#!/bin/bash
# This script resolves a DID, retrieves an API key, fetches a user's feed,
# and posts a "Hello, world" message to the user's feed.
# Resolve DID for handle
HANDLE='felicitas.pojtinger.com'
DID_URL="https://bsky.social/xrpc/com.atproto.identity.resolveHandle"
export DID=$(curl -G \
--data-urlencode "handle=$HANDLE" \
@Mefistophell
Mefistophell / RUST.MD
Last active July 1, 2024 14:01
How to Compile a Rust Program on Mac for Windows

Question: I want to compile my Rust source code for the Windows platform but I use macOS.

Solution:

  1. Install target mingw-w64: brew install mingw-w64
  2. Add target to rustup: rustup target add x86_64-pc-windows-gnu
  3. Create .cargo/config
  4. Add the instructions below to .cargo/config
[target.x86_64-pc-windows-gnu]
@fboris
fboris / stm_native_bootloader.md
Last active June 25, 2024 11:22
dfu-util command for uploading firmware on ST devices
  1. Let device to enter dfu-mode. And use dfu-util to get available devices

sudo dfu-util -l

It will show like...

Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 g,01*016 g", serial="3262355B3231"
Found DFU: [0483:df11] ver=2100, devnum=32, cfg=1, intf=0, alt=1, name="@Option Bytes  /0x1FFFC000/01*016 g", serial="3262355B3231"
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active July 5, 2024 04:29
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
/*
A Minimal Capture Program
This program opens an audio interface for capture, configures it for
stereo, 16 bit, 44.1kHz, interleaved conventional read/write
access. Then its reads a chunk of random data from it, and exits. It
isn't meant to be a real program.
From on Paul David's tutorial : http://equalarea.com/paul/alsa-audio.html