Skip to content

Instantly share code, notes, and snippets.

View pouretrebelle's full-sized avatar
🤒
Sick

Charlotte Dann pouretrebelle

🤒
Sick
View GitHub Profile
@pouretrebelle
pouretrebelle / farrowAndBall.js
Created January 14, 2023 21:02
Fetch hex codes of paint colours from Farrow & Ball https://www.farrow-ball.com/paint-colours
let tiles = document.body.querySelectorAll('.product-tile--paint');
let colors = [];
var matchRGB = /rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/;
function rgbToHex(r, g, b) {
return '#' + ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);
}
Array.from(tiles).forEach((tile) => {
@pouretrebelle
pouretrebelle / encodeNumberArray.js
Created September 7, 2022 11:56
Taking a long array of integers between -1 and 1, code golfing it into base 36 and then decoding it
const encodeNumbers = (array) => {
const chunk = (arr, len) => {
var chunks = [],
i = 0,
n = arr.length;
while (i < n) {
chunks.push(arr.slice(i, i += len));
}
return chunks
}
I am attesting that this GitHub handle pouretrebelle is linked to the Tezos account tz2Ja8LwHuzSLP7NdxH2fpRL16og2H21owR8 for tzprofiles
sig:spsig1Mw9UEuP4L2dyPxdsuK4A3FZDThFSZh9mxX7u2rDQR7wKx1t7yesDVpQ6X4Qcivi8vhWoYPbm7DM2bJXeG8whnP8KanZwx
@pouretrebelle
pouretrebelle / compileChangelog.js
Created July 5, 2021 12:49
Generate a CHANGELOG.md file from GitHub releases
const fs = require('fs')
const { Octokit } = require('@octokit/core')
const prettier = require('prettier')
const defaultPrettierConfig = require('../.prettierrc')
const prettierConfig = {
...defaultPrettierConfig,
parser: 'markdown',
}
class Vector2 {
constructor(x, y) {
this.x = x || 0;
this.y = y || 0;
}
reset(x, y) {
this.x = x;
this.y = y;
return this;
// Painting things
//================
int screenWidth = 1800;
int screenHeight = 1800;
int predraw = 1000; // frames per paint
Dot[] dots = new Dot[10]; // amount of paints
int iteration = 1; // name of saved png
boolean saving = false; // save to png
float framesPerSec = 1; // frame rate
@pouretrebelle
pouretrebelle / SassMeister-input.sass
Created January 16, 2015 15:55
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$themes: ("a": #ffcc00, "b": #00ddee)
=theme-color($prop: color)
@each $theme, $color in $themes
.theme--#{$theme} &