Skip to content

Instantly share code, notes, and snippets.

require("L5")
local lines = {}
local lineCount = 10
local velocity = 3
function setup()
windowTitle('Walking Lines')
size(680, 680)
// ==UserScript==
// @name Mastodon: Keep Local Feed Quieter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Stop publicly replying to your own posts on Mastodon.
// @author Orllewin
// @match https://merveilles.town/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=merveilles.town
// @grant none
// ==/UserScript==
@orllewin
orllewin / main.dart
Last active October 25, 2022 18:16
reverberating-performance-7459
void main() {
print('DartWhen');
var x = 1;
when(x, {
1: () => print("is 1"),
2: () => print("is 2"),
3: () {
print("is 3");
@orllewin
orllewin / main.dart
Last active October 25, 2022 14:22
alluring-lotus-3583
//Exploring basic Kotlin style _when_ syntax in Dart
void main() {
int code = 100;
var x = when(code,{
100: 1,
200: () => print("Success"),
400: () => print("Client Error"),
500: () => print("Server Error"),
(code > 400 && code < 500): () => print("Undefined client error: $code")
@orllewin
orllewin / LluniauWeb.kt
Created March 13, 2022 19:11
Basic gameloop in Kotlin JS
import kotlinx.browser.document
import kotlinx.browser.window
import org.w3c.dom.CanvasRenderingContext2D
import org.w3c.dom.HTMLCanvasElement
import kotlin.random.Random
lateinit var context: CanvasRenderingContext2D
lateinit var canvas: HTMLCanvasElement
fun main() {
@orllewin
orllewin / imgwiden.sh
Last active February 27, 2022 18:06
Stretches images horizontally by the given scale factor, used to correct images taken with an anamorphic lens
#!/bin/bash
echo -e "\n\tIMGWIDEN\n\tAnamorphic photo utility\n"
# Check ImageMagick Identify is available
if ! command -v identify &> /dev/null
then
echo -e "'identify' could not be found, make sure you have ImageMagick fully installed\n"
exit
fi
package orllewin.osname
import android.content.Context
import android.content.pm.PackageManager
/**
* Don't forget to add the packages to the manifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ... >
<queries>
<package android:name="app.grapheneos.camera" />
package orllewin.lutcreator
import android.graphics.Bitmap
import com.google.android.renderscript.LookupTable
import com.google.android.renderscript.Toolkit
/**
*
* Fast Bitmap colour channel filtering
/**
* Calculates 256 values from a curve to drive a Toolkit LookupTable which uses a byte array with length 256
* eg. for a red channel the zeroth index in the array has value 0 (black), index 255 has value 255 (pure red)
* but... the values returned here are just the ui input mapped to 0 to 255
* @param curveId - the name of the curve, "RED", "GREEN", "BLUE", "LUMI"
* @return FloatArray with values mapped from the ui in range 0 to 255
*/
fun getData(curveId: String): FloatArray{
//The view can have n curves, find the one with the id we want
@orllewin
orllewin / UnrealLutToolkit.kt
Created January 16, 2022 23:37
Use Unreal format 256x16 LUTs with Google's RenderScript Intrinsic replacement Toolkit native library
package orllewin.haldclut_impl
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.Color
import com.google.android.renderscript.Rgba3dArray
import com.google.android.renderscript.Toolkit
/**