Skip to content

Instantly share code, notes, and snippets.

View jelofsson's full-sized avatar
🏡
Working from home

Jimmi Elofsson jelofsson

🏡
Working from home
View GitHub Profile
@jelofsson
jelofsson / mosaic.py
Created April 20, 2024 08:24
Generates an mosaic image based on images in path
#
# example usage:
# python3 mosaic.py <source-path> <x-size> <y-size> <images-per-row> <spacing>
# python3 mosaic.py ./images/ 512 512 8 0
#
import os
import sys
from PIL import Image, ImageDraw
@jelofsson
jelofsson / rarity-score.py
Created April 5, 2024 12:42
calculate rarity score - nft-generator-py helper
import json
import csv
from collections import Counter
#
# example usage: python3 rarity-score.py
#
# Load the JSON data
with open('./output/metadata/all-objects.json') as f:
@jelofsson
jelofsson / find-traits.py
Created April 5, 2024 12:37
find-traits - nft-generator-py helper
import json
import sys
from collections import Counter
import csv
#
# example usage:
# python find-traits.py "trait1,trait2,trait3"
#
@jelofsson
jelofsson / remove-none-attributes.py
Created April 5, 2024 12:32
Remove None Attributes - nft-generator-py helper
import os
import json
import glob
import re
# Get all JSON files in the directory
json_files = glob.glob('output/metadata/*.json')
for json_file in json_files:
# Check if the filename is a number
@jelofsson
jelofsson / slack.repo
Created June 13, 2023 20:15
slack.repo
[slack]
name=Slack
baseurl=https://packagecloud.io/slacktechnologies/slack/fedora/21/$basearch
gpgcheck=1
enabled=1
gpgkey=https://slack.com/gpg/slack_pubkey_20220708.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300