Skip to content

Instantly share code, notes, and snippets.

View DannyDannyDanny's full-sized avatar
👾
exploring codespaces

Daniel Thoren DannyDannyDanny

👾
exploring codespaces
  • Data Engineer @ Lundbeck [DNTH]
  • Copenhagen
View GitHub Profile
import random as r
import matplotlib.pyplot as plt
# Generate rolls
n_rolls = 1000000
rolls = [(r.randint(1,6),r.randint(1,6)) for i in range(n_rolls)]
flat_list = [item for sublist in rolls for item in sublist]
plt.hist(flat_list,bins=12)
plt.show()
# %%
@DannyDannyDanny
DannyDannyDanny / ColorDepthReduction.md
Last active November 19, 2020 08:32
StoryTelling Resources

Color depth reduction

convert plant1c.jpeg +dither -colors 8 plant8.jpeg

plant1

plant16

@DannyDannyDanny
DannyDannyDanny / colortrans.py
Last active October 8, 2019 21:49 — forked from hoov/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes - python3
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code