Skip to content

Instantly share code, notes, and snippets.

View L-A's full-sized avatar

Louis-André Labadie L-A

View GitHub Profile
@L-A
L-A / XTZ proof.md
Last active October 17, 2022 14:47
A signed proof that I own this Github account

I am attesting that this GitHub handle l-a is linked to the Tezos account tz1TXPoPrWjn4PSbXe6L66Kqo9NVCWiEw17Q for tzprofiles

sig:edsigu1NfTcRc1HZxjkD7iCFyFvsXWCVm1tfHdg85M59iswuUCiajZKSnqmZ84b63V5eGWM53WuiEgdD8WpkoFxsNmnMhxAFjMT

@L-A
L-A / hatchPolygon.js
Created October 5, 2022 14:27
Hatch an arbitrary polygon
/*
Arguments:
Points is an ordered array of polygon points, each as an object with {x,y}
Hatching angle is in radians
Spacing is the space between each hatching line
Returns an array of lines objects in the shape [{start: {x,y}, end: {x,y}}]
*/
@L-A
L-A / verification.txt
Created February 24, 2022 21:57
tzprofile verification
I am attesting that this GitHub handle l-a is linked to the Tezos account tz1ZvTGYH5EBwgmaYngELeUw1qzgQRJLKoDM for tzprofiles
sig:edsigu2maSpWYAcvoticw3aCQGPuNpQbXRpBgt3pd2iqW4jTTcKKMCnWSDicA76FhnAESFmxxz1RqvJ4E3aUxWK3pYnEVNNv9ZR
@L-A
L-A / Liens-WAQ21.md
Last active June 16, 2021 12:32
Les liens et ressources mentionnés dans ma présentation sur l'art génératif au #WAQ21
@L-A
L-A / linked-list.js
Last active February 2, 2021 17:21
Javascript linked list class
class LinkedList {
constructor(initialElement) {
this.length = 1;
this.head = initialElement;
this.head.next = this.head;
this.head.prev = this.head;
}
// Just to be nice.
value() {
@L-A
L-A / quadtree.js
Created October 19, 2020 20:25
Basic quadtree implementation in JS
// Utilities
const distance = (x1, y1, x2, y2) =>
Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
// The quadtree
export default class QuadTree {
constructor(x, y, width, height, capacity = 4) {
this.x = x;
@L-A
L-A / Static.swift
Created July 20, 2020 19:48
Static struct properties in Swift
struct Vehicle {
// Here are four struct properties: Three are
// required when I initialize an instance, and
// the fourth is computed
var name: String
let consumptionInLper100km: Float
let fuelCapacityInL: Float
var autonomy: Float {
return fuelCapacityInL * (100/consumptionInLper100km);
}
@L-A
L-A / canvas-sketch-shaders.js
Created May 30, 2020 04:42
Simple web GLSL using canvas-sketch
import canvasSketch from "canvas-sketch";
import createShader from "canvas-sketch-util/shader";
import glsl from "glslify";
// Note that you need to install `glslify` and `canvas-sketch-util`
// separately from `canvas-sketch`
// Configuration
const width = 8,
height = 6,
@L-A
L-A / spotify-now-playing.jsx
Last active March 7, 2024 03:36
Übersicht widget to display Spotify's currently playing track when there's one.
import { run, styled } from "uebersicht";
const refreshFrequency = 500;
const size = 80;
const Sep = "⎖"; // Ideally, this is never a character in a song title!
const command = async (dispatch) => {
refresh(dispatch);
};
@L-A
L-A / scratched-circles.js
Created October 25, 2019 19:44
Sample code to generate scratched circles sketches using canvas-sketch
import canvasSketch from "canvas-sketch";
import randomPalette from "../helpers/goodPalette";
import SimplexNoise from "../helpers/simplex";
import random from "../helpers/random";
// In inches
const width = 8,
height = 8;
// Random inputs