Skip to content

Instantly share code, notes, and snippets.

View iwuvjhdva's full-sized avatar

Konstantin Alexandrov iwuvjhdva

  • Stockholm, Sweden
View GitHub Profile
@iwuvjhdva
iwuvjhdva / generate_colors.py
Created October 24, 2018 20:34
Generate cryptocurrency colours from cryptocurrency-icons SVGs
#!/usr/bin/env python3
import os
svg_path = './icons/'
scss_path = './currency-colors.scss'
def get_colors(path):
colors = {}
file_names = os.listdir(path)
@iwuvjhdva
iwuvjhdva / generate-icons.sh
Last active July 31, 2018 15:31
Generate icons for an Electron app using one transparent 1024x1024 PNG
#!/bin/sh
if ! [ -x "$(command -v convert)" ]; then
echo 'Error: ImageMagick is not installed' >&2
echo 'Use brew install imagemagick on Mac OS X' >&2
exit 1
fi
if [ $# -eq 0 ]; then
echo 'Usage: generate-icons.sh <1024x1024 icon file name.png>' >&2
@iwuvjhdva
iwuvjhdva / capture_zap_output.go
Created October 26, 2017 13:21
Capture Golang Zap logger output for unit tests
import (
"bufio"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
/*
Global Logger variable is a Zap logger.