Skip to content

Instantly share code, notes, and snippets.

View guidoschmidt's full-sized avatar

Guido Schmidt guidoschmidt

View GitHub Profile
@guidoschmidt
guidoschmidt / closure.zig
Created November 2, 2023 22:19 — forked from MasterQ32/closure.zig
Zig Closure Implementation
const std = @import("std");
pub fn main() void {
std.log.info("mutable closure:",.{});
runMutDemo();
std.log.info("const closure:",.{});
runConstDemo();
}
@guidoschmidt
guidoschmidt / irc.md
Created December 9, 2022 19:39 — forked from xero/irc.md
irc cheat sheet

IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
  • Leaves the specified channel.
@guidoschmidt
guidoschmidt / css
Created October 31, 2021 11:29 — forked from mateuszkocz/css
Disable image smoothing. Comes in handy when creating pixel-art game. The pixels will stay sharp.
/* You can aslo add */
canvas {
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
-ms-interpolation-mode: nearest-neighbor;
}
@guidoschmidt
guidoschmidt / ObjectPool.js
Created March 16, 2021 09:06 — forked from mattdesl/ObjectPool.js
object pooling for zero-allocation JS game dev
// Modified version of ECSY's ObjectPool, see here:
// https://github.com/ecsyjs/ecsy/blob/dev/src/ObjectPool.js
const ret = (e) => e;
const und = () => undefined;
export default class ObjectPool {
static isObjectPool = true;
constructor(opt = {}) {
@guidoschmidt
guidoschmidt / hic_et_nunc_basic_scraper.py
Created March 11, 2021 12:21 — forked from schwittlick/hic_et_nunc_basic_scraper.py
This is a very basic no-frills scraper to retrieve the metadata and digital assets from all tokens minted on hicetnunc.xyz. I share this as a starting point for people who want to experiment with building alternative views on the works created on the platform or preserve the data. Feel free to improve upon this or add additional features.
import requests
import os
import ipfsapi
import concurrent.futures
api = ipfsapi.Client(host='https://ipfs.infura.io', port=5001)
url = "https://better-call.dev/v1/contract/mainnet/KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton/tokens"
r = requests.get(url)
@guidoschmidt
guidoschmidt / gs.sh
Created December 11, 2020 10:54 — forked from esrever10/gs.sh
gstreamer send and receive h264 rtp stream
# linux send h264 rtp stream:
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# Macos send h264 rtp stream:
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000
# receive h264 rtp stream:
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink
@guidoschmidt
guidoschmidt / Matrix.hlsl
Created November 25, 2020 22:10 — forked from mattatz/Matrix.hlsl
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
@guidoschmidt
guidoschmidt / gstreamer.md
Created May 20, 2020 14:22 — forked from nebgnahz/gstreamer.md
Collections of GStreamer usages

Most GStreamer examples found online are either for Linux or for gstreamer 0.10.

This particular release note seems to have covered important changes, such as:

  • ffmpegcolorspace => videoconvert
  • ffmpeg => libav

Applying -v will print out useful information. And most importantly the negotiation results.

@guidoschmidt
guidoschmidt / UniversalPipelineTemplateShader.shader
Created May 15, 2020 08:13 — forked from phi-lira/UniversalPipelineTemplateShader.shader
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@guidoschmidt
guidoschmidt / install.sh
Last active August 17, 2019 21:07 — forked from Danw33/install.sh
macOS Homebrew Install FFMPEG --with all options
2019
brew install nasm pkg-config texi2html aom fontconfig freetype frei0r gnutls lame libass libbluray libsoxr libvorbis libvpx opencore-amr openjpeg opus rtmpdump rubberband sdl2 snappy speex tesseract theora x264 x265 xvid xz
brew install ffmpeg