Skip to content

Instantly share code, notes, and snippets.

View Johnny1776's full-sized avatar
πŸ‘¨β€πŸ’»
Coding

Johnny D Johnny1776

πŸ‘¨β€πŸ’»
Coding
View GitHub Profile
@Johnny1776
Johnny1776 / ExampleColorSchemes.swift
Created July 18, 2023 13:07
Simple View represents common UI System Colors for iOS and macOS.
import SwiftUI
#if os(iOS)
import UIKit
#endif
/**
Display a simple view of the common system colors used for interface design. Quick reference that if in Canvas will display in a larger format.
*/
struct ExampleColorSchemes: View {
@laanwj
laanwj / blocktoimg.py
Last active January 31, 2024 11:06
tools to write (block) data to png files and vice versa
#!/usr/bin/env python3
# Distributed under the MIT software license
import binascii, struct, sys, io, argparse
from PIL import Image
IMG_WIDTH = 512 # could be made adaptive...
MIN_HEIGHT = 4 # minimum height of image; twitter won't let us upload anything smaller
BYTES_PER_PIXEL = 4 # RGBA, 8 bit
def div_roundup(x,y):