Skip to content

Instantly share code, notes, and snippets.

@stephanschubert
stephanschubert / RGB to CMYK with caching
Last active August 30, 2015 14:24
Convert CMYK to RGB with automatic caching
cmyk = Hash.new do |cache, rgb|
cmy = rgb.map { |color| 255 - color }
k = cmy.min
cache[rgb] = cmy.map { |color| color - k } + [k]
end
# Usage
cmyk[ [128, 42, 23] ] # => [0, 86, 105, 127]
@pgilad
pgilad / Instructions.md
Last active March 27, 2024 12:59
Generate SSL Certificate for use with Webpack Dev Server (OSX)

Generate private key

$ openssl genrsa -out private.key 4096

Generate a Certificate Signing Request

openssl req -new -sha256 \
@raftheunis87
raftheunis87 / hyperjs.md
Last active June 14, 2024 14:48
Hyper.js + Hyper.js Plugins + ZSH + Starship + Fira Code + Dark Theme - (macOS)

Hyper.js