Skip to content

Instantly share code, notes, and snippets.

#include <FastLED.h>
#define LED_PIN 7
#define NUM_LEDS 240
CRGB leds[NUM_LEDS];
int offset = 0;
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
@programmarchy
programmarchy / install.sh
Created April 14, 2021 03:53
Modified install script to locally install Deno version manager (dvm)
#!/bin/sh
# Copyright 2019 the Deno authors. All rights reserved. MIT license.
# Copyright 2020 justjavac. All rights reserved. MIT license.
# TODO(everyone): Keep this script simple and easily auditable.
set -e
# if [ "$(uname -m)" != "x86_64" ]; then
# echo "Error: Unsupported architecture $(uname -m). Only x64 binaries are available." 1>&2
# exit 1
@programmarchy
programmarchy / generate_blender_materials.py
Last active January 28, 2022 21:40
Blender script which, given an active object, copies the material for that object assigning new PBR texture maps from a local directory structure
import bpy
active_object = bpy.context.active_object
col_width = 10
if active_object is None:
raise Exception("Select an object to use as a template")
for i in range(1, 100):
n = i + 1
@programmarchy
programmarchy / gist:d2ce0270a89bcd102220748a58d0303e
Last active January 13, 2024 02:06
Quixel Bridge MSPlugin modified for Blender 3.0
# ##### QUIXEL AB - MEGASCANS PLugin FOR BLENDER #####
#
# The Megascans Plugin plugin for Blender is an add-on that lets
# you instantly import assets with their shader setup with one click only.
#
# Because it relies on some of the latest 2.80 features, this plugin is currently
# only available for Blender 2.80 and forward.
#
# You are free to modify, add features or tweak this add-on as you see fit, and
# don't hesitate to send us some feedback if you've done something cool with it.
@programmarchy
programmarchy / hono-superjson-middleware.ts
Created March 18, 2025 21:26
SuperJSON middleware for Hono
import type { MiddlewareHandler } from "hono"
import superjson from "superjson"
export const superjsonMiddleware = (): MiddlewareHandler => {
return async (c, next) => {
if (c.req.header("x-superjson") === "true") {
const json = c.json.bind(c)
c.json = (object: any, ...args: any[]) => {
return json(superjson.serialize(object), ...args)
}