This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sizes from https://developer.apple.com/library/ios/#qa/qa1686/_index.html | |
# Requirements: ImageMagick | |
function resize { | |
GREEN='\033[0;32m' | |
BLUE='\033[0;34m' | |
DEFAULT='\033[0m' | |
echo -e "Generating ${BLUE}$3${DEFAULT} at size ${GREEN}$2 ${DEFAULT}" | |
convert $1 -resize $2 $3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
extension UIView { | |
func spanSuperView() { | |
guard superview != nil else { return } | |
self.topAnchor.constraint(equalTo: superview!.topAnchor).isActive = true | |
self.leadingAnchor.constraint(equalTo: superview!.leadingAnchor).isActive = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.swift | |
// | |
import UIKit | |
import CoreData | |
import Firebase | |
import TwitterKit | |
import FBSDKCoreKit | |
import Branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
struct Thing: Decodable { | |
let id: String | |
let isActive: Bool | |
let name: String | |
let owner: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
extension UIView { | |
func asCircle(){ | |
self.layer.cornerRadius = self.frame.width / 2; | |
self.layer.masksToBounds = true | |
} |
NewerOlder