Skip to content

Instantly share code, notes, and snippets.

@tgzw
tgzw / pygame_no_message.py
Created July 14, 2023 10:11
Deactivate initial message of Hello from the pygame community from Pygame
from os import environ
environ['PYGAME_HIDE_SUPPORT_PROMPT'] = '1'
import pygame
@tgzw
tgzw / AutoHotKey_Greater_Lower_volume.ahk
Created March 20, 2023 12:27
AutoHotKey script for <, > and volume control
; List of Keys:
; https://www.autohotkey.com/docs/v1/KeyList.htm
#NoEnv ;
; #Warn ;
SendMode Input ;
SetWorkingDir %A_ScriptDir% ;
; ctrl + alt + z = <
^<!z::
@tgzw
tgzw / dynmap_nether_roof_map.md
Last active June 13, 2025 21:56
Tutorial to add a 3D/Surface (or Top) view of the nether roof to the dynmap maps.

3D/Surface (or Top) view of the Nether Roof in Dynmap

  1. Open <server>/dynmap/custom-perspectives.txt
  2. Below the line perspectives: and add the following:
  - class: org.dynmap.hdmap.IsoHDPerspective
    name: nether_SE_map_hires
    maximumheight: 256
    minimumheight: 128
    inclination: 30
 scale: 16
@tgzw
tgzw / perlin-noise.py
Created November 9, 2022 01:51
Perlin noise in python using the perlin-noise package. 3-4 octaves seem to be the ideal.
# !pip install perlin-noise
import matplotlib.pyplot as plt
from perlin_noise import PerlinNoise
noise = PerlinNoise(octaves=3, seed=1)
xpix, ypix = 100, 100
pic = [[noise([i/xpix, j/ypix]) for j in range(xpix)] for i in range(ypix)]
plt.imshow(pic, cmap='gray')
@tgzw
tgzw / notes_by_tag.js
Created September 5, 2022 12:47
Snippet of code for the Obsidian extension Dataview, to show all the notes grouped by unique tags.
```dataviewjs
// Fetching unique tags
let tags = []
for (let tag of dv.pages('"notes"').file.tags) {
if (tags.indexOf(tag) == -1) {
tags.push(tag)
}
}
// Table for each tag
dv.header(5,"Notes by tag:")
@tgzw
tgzw / c.json
Created September 3, 2022 09:17
C vscode snippet to add a header documentation section with the filename, your name and the current date
{
"Documentation section": {
"prefix": "/*doc",
"body": [
"/*",
" $TM_FILENAME_BASE",
" Author: tgzw",
" Date : $CURRENT_YEAR-$CURRENT_MONTH-${CURRENT_DATE}",
"*/"
],