Skip to content

Instantly share code, notes, and snippets.

View miguno's full-sized avatar

miguno miguno

  • Europe
  • 13:24 (UTC +02:00)
  • X @miguno
View GitHub Profile
miguno /
Last active September 18, 2023 13:07
Setup for `just` on Windows 11: PowerShell aliases

To create an alias for just named j in Powershell that sets just's default shell to PowerShell itself, create a PowerShell profile with the following contents.

### PowerShell profile
### Installation
### ============
### Store this file at `$HOME\Documents\PowerShell\Profile.ps1`,
miguno /
Created September 4, 2023 22:37 — forked from xPaw/
Counter-Strike 2 Text Mod

Installing text mod

  1. Click this link to download the file (Ctrl+S)
  2. Name this file csgo_textmod.txt and put it inside this folder: Steam\SteamApps\Common\Counter-Strike Global Offensive\game\csgo\resource
    • Notice the game\csgo (CS2) folder, and not just csgo (CS:GO).
  3. Add -language textmod to your launch options

Not working? Make sure that:

  • csgo_textmod.txt is placed in the right folder (it needs to be inside the CS2 game\csgo\resource folder)
  • Launch option is spelled correctly, this is an example that will work: -novid -language textmod
miguno /
Last active January 10, 2023 16:43 — forked from peterbartha/
Convert Rust books to EPUB (incl. The Rust Programming Language)

Convert Rust books to EPUB (incl. The Rust Programming Language)

The following steps work for all the HTML learning materials on the Learn Rust page:

  1. Click on the "Print this book" icon in the top right corner.
  2. "Cancel" print popup.
  3. Press F12 (on Firefox) to open the browser console. Or: Tools > Browser Tools > Web Developer Tools, then switch to Console tab.
  4. Copy, paste, and run the contents of ebookFormatPreparation.js into your browser's console.
  5. Save the modified HTML file.
miguno / detectStdin.go
Last active March 26, 2022 21:40
Detect whether golang application is reading input from STDIN
func isInputFromStdin() bool {
info, err := os.Stdin.Stat()
if err != nil {
if info.Mode()&os.ModeNamedPipe == 0 {
return false
} else {
return true
miguno / copartitioning.sql
Last active November 28, 2019 14:45
ksqlDB example: creates a new stream with changed number of partitions and a new field as event key (so that its data can be correctly co-partitioned for joining)
CREATE STREAM products ...;
CREATE STREAM products_repartitioned
SELECT * FROM products
PARTITION BY product_id
miguno / increased-partitions.sql
Last active January 11, 2020 00:14
ksqlDB example: Create a new stream with the desired number of partitions.
CREATE STREAM products ...;
CREATE STREAM products_repartitioned
SELECT * FROM products
miguno /
Last active January 9, 2020 07:56
Kafka Streams Example: read topic as table
// Create KTable from Kafka topic.
KTable<String, String> table = builder.table("input-topic", Consumed.with(Serdes.String(), Serdes.String()));
miguno / topic-as-table.sql
Last active January 9, 2020 07:56
ksqlDB example: read topic as table
-- Create ksqlDB table from Kafka topic.
CREATE TABLE myTable (username VARCHAR, location VARCHAR)
WITH (KAFKA_TOPIC='input-topic', KEY='username', VALUE_FORMAT='...');
miguno / topic-as-stream.sql
Last active January 9, 2020 07:37
ksqlDB example: read topic as stream
-- Create ksqlDB stream from Kafka topic.
CREATE STREAM myStream (username VARCHAR, location VARCHAR)
WITH (KAFKA_TOPIC='input-topic', VALUE_FORMAT='...');