Skip to content

Instantly share code, notes, and snippets.

View nclslbrn's full-sized avatar

Nicolas Lebrun nclslbrn

View GitHub Profile
@nclslbrn
nclslbrn / console.js
Last active June 27, 2023 19:16
Get fxhash edition ipfs thumbnail link and project name
// Copy this code in the dev tools console after reaching the end of the page (scroll down to the page bottom)
let output = '', name = String(document.title).replace('fxhash — ', '')
Array.from(document.querySelectorAll('a[href*="/gentk/"]')).forEach((a, i) => {
const img = a.querySelector('img')
output += `<a href="${a.href}" target="_blank"><img loading="lazy" alt="${name} #${i+1}" src="${img.src}"></a>`
})
output += ''
console.log(output)
@nclslbrn
nclslbrn / flat-array.js
Last active January 26, 2024 09:25
Khroma palettes - scrapped from dev tools
// Scrap Khroma palette
// https://www.khroma.co/generator
const componentToHex = (c) => {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
}
const rgbToHex = (r, g, b) => "#" + componentToHex(r)+componentToHex(g)+componentToHex(b);
const palettes = []
@nclslbrn
nclslbrn / index.js
Created September 16, 2022 17:18
NodeJS script to sort collectors by editions (from multiple tokens) collectors.csv from https://fxcollectors.stroep.nl/
const fs = require('fs')
function getCollectors(number) {
const data = fs.readFileSync('./collectors.csv', 'utf8')
let lines = data.split('\n').slice(1)
const collectorsObject = {}
lines.forEach((l) => {
if(l.length === 0) return
const row = l.split(' ')
#!/bin/bash
sleep
export DISPLAY=:0.0
firefox -url http://chat.expo &
sleep 5
xdotool search --name ".*Mozilla Firefox" key F11
xdottol mousemove 0 1080