Skip to content

Instantly share code, notes, and snippets.

@joslarson
joslarson / typed-bitwig-api.d.ts
Created November 20, 2020 20:17
Typed Bitwig API v12
declare namespace com.bitwig.extension {
// source: com/bitwig/extension/Extension.java
import Host = com.bitwig.extension.api.Host;
class Extension<
HostType extends Host = Host,
DefinitionType extends ExtensionDefinition = ExtensionDefinition
> {
constructor(extensionDefinition: DefinitionType, host: HostType);
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@ompuco
ompuco / PSXDither.hlsl
Last active May 23, 2025 22:00
Color dither & truncation based on Sony's PlayStation (1) hardware features & limitations.
#ifdef PSXDTH
#else
#define PSXDTH
//PS1 Hardware Dithering & Color Precision Truncation Function
//by ompu co | Sam Blye (c) 2020
//PS1 dither table from PSYDEV SDK documentation
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active August 10, 2025 05:15
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

WARNING: Article moved to separate repo to allow users contributions: https://github.com/raysan5/custom_game_engines

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like [Unreal](https:

@IRCSS
IRCSS / SmoothGameCameraMovement.cs
Last active May 10, 2023 03:03
Unity Camera Movement in Game view like Scene View with filtering
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Moves Camera similar to how camera is moved in the Unity view port. Drop the scrip on the game object which has the camera and you wish to move.
public class SmoothGameCameraMovement : MonoBehaviour
{
public float lateralSpeed = 0.0015f;
@AlvarBer
AlvarBer / Toon Lit.shader
Last active June 1, 2025 18:30
Toon lit & unlit "uber" shader
// TODO: Do fresnel the ronja way
Shader "HCF/3D/Toon Lit" {
Properties {
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Tint("Tint", Color) = (1, 1, 1, 1)
[Header(Lighting)]
[Toggle]
_UseRampText("Use Ramp Texture", Float) = 0
[NoScaleOffset]
_RampTex("Ramp Texture (Greyscale)", 2D) = "white" {}
@Merott
Merott / tailwind-colors-as-css-variables.md
Last active July 7, 2025 22:40
Expose Tailwind colors as CSS custom properties (variables)

This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root element.

There are a couple of main reasons this is helpful:

  • You can reference all of Tailwind's colors—including any custom ones you define—from handwritten CSS code.
  • You can define all of your colors within the Tailwind configuration, and access the final values programmatically, which isn't possible if you did it the other way around: referencing custom CSS variables (defined in CSS code) from your Tailwind config.

See the Tailwind Plugins for more info on plugins.

@markosjal
markosjal / AirScan-eSCL.txt
Last active February 1, 2025 23:49
Reverse Engineering eSCL / Apple AirScan
Reverse Engineering the Apple Airscan / eSCL Protocol
I am not certain of the origins, one person involved in IPP printing claimed it was proprietary of HP , but then again they have their own protocol. AirScan/eSCL is used by other manufacturers too like Xerox, Kyocera, Canon and more. Mopria also seems to claim some responsibility for it but then again it seems not completely. In any case it seems shrouded in such secrecy that to date several years after its implementation, unless someone wants to take it all apart.
I offer this as my contribution. It is not perfect but almost there.
As I began looking for information to make a scanner more compatible, I could only find fragments of information. Even Apple Developer Forums offered zero help.
Server/Client in eSCL / AirScan:
There is a “server”and a “client” the client can be a desktop computer or mobile device. The server is a scanner or another device configured to emulate a hardware scanner, even a desktop computer. In my case I did this on Linux, so
@laravel-shift
laravel-shift / .shiftrc
Last active July 21, 2022 15:23
Default configuration file for setting Shift preferences
; Within this file you may set preferences for Shift.
; These may be used to customize the behavior of the
; Shift bot by disabling or guiding the automation.
; NOTE: Any paths should be relative to location
; of this file and exclude a trailing slash.
; Section to set options for PHP Shifts.
[php]