Skip to content

Instantly share code, notes, and snippets.

View monkeywithacupcake's full-sized avatar
coffee me

jess monkeywithacupcake

coffee me
View GitHub Profile
@monkeywithacupcake
monkeywithacupcake / catchphrase.sh
Created September 8, 2018 13:56
A shell script to generate an Image with text
#!/bin/zsh
# Asks a series of questions and then returns an image
# use like "bash catchphrase.sh"
echo "What is your favorite color?"
read theColor
echo "What is your catchphrase?"
read thePhrase
convert -size 1000x1000 xc:$theColor +repage \
-size 800x800 -fill white -background None \
@monkeywithacupcake
monkeywithacupcake / encourageme.sh
Created September 8, 2018 14:01
A shell script to return a random string
#!/bin/zsh
# returns a random phrase for motivation
# usage `bash encourageme.sh`
aff=("You are enough" "Do one small thing" "Sources say that you can do it" "Just try" "You got this" "You are what you repeatedly do")
theaff=${aff[$(( $RANDOM % ${#aff[@]} + 1 ))]}
say $theaff
echo $theaff
@monkeywithacupcake
monkeywithacupcake / ScalingStaticPieChart.swift
Last active December 31, 2021 11:31
This is a scaling static pie chart - use as starter code for your project. This is based on the code in [App Coda's tutorial](https://www.appcoda.com/swiftui-pie-chart/) but it scales into whatever frame it is in rather than having hard coded center and radius. I've also changed the clockwise parameter to false to allow for logical building.
import SwiftUI
struct ScalingStaticPieChart: View {
var body: some View {
GeometryReader { geometry in
let gc = geometry.size.width * 0.5
let gcenter = CGPoint(x: gc, y: gc)
let outsize = geometry.size.width * 0.4
ZStack {