Skip to content

Instantly share code, notes, and snippets.

View LukeberryPi's full-sized avatar

LukeberryPi LukeberryPi

View GitHub Profile
@LukeberryPi
LukeberryPi / romanToInteger.js
Created October 25, 2023 00:19
roman to integer javascript function
function romanToInteger(roman) {
const romanNumerals = {
I: 1,
V: 5,
X: 10,
L: 50,
C: 100,
D: 500,
M: 1000,
};
@LukeberryPi
LukeberryPi / main.py
Created October 22, 2023 23:01
a python program to select chords in a harmonic field
import random as rd
random = rd
tom = ['A','B','C','D','E','F','G']
number_chords = [3,4,5]
tom_a = ['A','Bm','C#m','D','E','F#m']
tom_b = ['B','C#m','D#m','E','F#','G#m']
tom_c = ['C','Dm','Em','F','G','Am']
tom_d = ['D','Em','F#m','G','A','Bm']
@LukeberryPi
LukeberryPi / index.html
Created October 20, 2023 22:16
how to justify three elements in a container and keep the middle one centered regardless of children size
<div class="flex justify-between">
<div class="flex flex-1 justify-start">huuuuuuuuuuuuge left element</div>
<div class="flex flex-1 justify-center">center element</div>
<div class="flex flex-1 justify-end">right element</div>
</div>
@LukeberryPi
LukeberryPi / generateRandomHexcode.js
Created October 20, 2023 22:02
function to generate a random hexcode
function generateRandomHexCode() {
const validChars = "abcdef0123456789";
let hexcode = "#";
for (let i = 0; i < 6; i++) {
const char = validChars[Math.floor(Math.random() * validChars.length)];
hexcode += char;
}
return hexcode;