Skip to content

Instantly share code, notes, and snippets.

View ataias's full-sized avatar

Ataias Pereira Reis ataias

View GitHub Profile
@ataias
ataias / app_icons_from_svg
Last active April 25, 2021 11:12
Generate png app icons in multiple formats from an SVG image
#!/usr/bin/env bash
# For this to work, you need imagemagick installed,
# which is the tool that provides "convert"
sizes='16 20 29 32 40 60 64 58 76 80 87 120 128 152 167 180 256 512 1024'
file=$1
for size in $sizes
do
@ataias
ataias / View+Extensions+Hidden.swift
Created February 13, 2021 11:38
SwiftUI Modifier: Conditionally hide a view
import SwiftUI
struct ConditionalHide: ViewModifier {
var hidden: Bool
@ViewBuilder
func body(content: Content) -> some View {
if hidden {
content.hidden()
} else {