Skip to content

Instantly share code, notes, and snippets.

@unitycoder
unitycoder / LineDrawer.cs
Created November 5, 2021 20:09
Drawing a line with Unity UI Toolkit
// Drawing a line with UITK https://forum.unity.com/threads/drawing-a-line-with-uitk.1193470/
public class LineDrawer : VisualElement
{
private Vector3 startPos, endPos;
private float thickness;
public LineDrawer(Vector3 pos1, Vector3 pos2, float width)
{
startPos = pos1;
endPos = pos2;
@Cyanilux
Cyanilux / GrassInstanced.hlsl
Last active February 13, 2025 05:24
Experiments with using DrawMeshInstancedIndirect with Shader Graph
// https://twitter.com/Cyanilux/status/1396848736022802435?s=20
#ifndef GRASS_INSTANCED_INCLUDED
#define GRASS_INSTANCED_INCLUDED
// ----------------------------------------------------------------------------------
// Graph should contain Boolean Keyword, "PROCEDURAL_INSTANCING_ON", Global, Multi-Compile.
// Must have two Custom Functions in vertex stage. One is used to attach this file (see Instancing_float below),
// and another to set #pragma instancing_options :
@bb010g
bb010g / + Python dev env with Nixpkgs.md
Last active March 15, 2025 14:29
Example Python development environment with Nixpkgs

Example Python development environment with Nixpkgs

This project requires Python 3.6.

This project isn't packaged, and traditionally uses:

$ python -m venv venv
$ source venv/bin/activate
$ pip install "${pypi_deps[@]}"
@define-private-public
define-private-public / HttpServer.cs
Last active April 22, 2025 09:49
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;