Skip to content

Instantly share code, notes, and snippets.

View RenovZ's full-sized avatar

RenovZ

View GitHub Profile
@xtrasmal
xtrasmal / create_icns.sh
Last active December 8, 2025 20:19
Create a .icns file and/or png placeholders. Uses imagick to create the placeholders.
#!/bin/bash
# Icons and names
ICONS=(
"icon_16x16.png:16x16"
"icon_16x16@2x.png:32x32"
"icon_32x32.png:32x32"
"icon_32x32@2x.png:64x64"
"icon_128x128.png:128x128"
"icon_128x128@2x.png:256x256"
@cloudwu
cloudwu / clog.c
Created February 5, 2024 04:49
concurrence log
#include "clog.h"
#include <stdatomic.h>
#include <stdlib.h>
#include <string.h>
#define LOGMETA_BUFFER 4096
#define LOGDATA_BUFFER (64 * 1024)
// [..........................]
// ^
@rbreaves
rbreaves / USBkbd-linux2mac.sh
Created December 12, 2021 06:47
Remap USB keyboards on Linux to be like an Apple Keyboard - swaps Alt/Win(Super)
sudo apt install evtest
sudo evtest
----------------------------------- No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Lid Switch
/dev/input/event1: Video Bus
/dev/input/event2: gpio-keys
/dev/input/event3: gpio-keys
/dev/input/event4: HDA Intel PCH Mic
- id: 'port-forward'
name: 'gcr.io/cloud-builders/docker'
args: [
'run',
'-itd',
'--network-alias', 'ml-pipeline.local',
'-e', 'CLOUDSDK_COMPUTE_ZONE=${_KF_ZONE}',
'-e', 'CLOUDSDK_CONTAINER_CLUSTER=${_KF_CLUSTER}',
'-e', 'CLOUDSDK_CORE_PROJECT=${_KF_PROJECT}',
'-p', '8888:8888',
@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active April 30, 2026 16:15
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@nmarley
nmarley / README.md
Last active April 27, 2026 02:25
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active June 3, 2026 08:58
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@mikesmullin
mikesmullin / trace.js
Created November 24, 2017 23:21
Node.JS print filename and line number prefixed to console log output
const path = require('path');
function trace(s) {
const orig = Error.prepareStackTrace;
Error.prepareStackTrace = (_, stack) => stack;
const err = new Error();
Error.captureStackTrace(err, arguments.callee);
Error.prepareStackTrace = orig;
const callee = err.stack[0];
process.stdout.write(`${path.relative(process.cwd(), callee.getFileName())}:${callee.getLineNumber()}: ${s}\n`);
@jaytaylor
jaytaylor / delete-from-v2-docker-registry.md
Last active May 19, 2026 21:03
One liner for deleting images from a v2 docker registry

One liner for deleting images from a v2 docker registry

Just plug in your own values for registry and repo/image name.

registry='localhost:5000'
name='my-image'
curl -v -sSL -X DELETE "http://${registry}/v2/${name}/manifests/$(
    curl -sSL -I \
        -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \