Skip to content

Instantly share code, notes, and snippets.

View mattcomi's full-sized avatar

Matt Comi mattcomi

View GitHub Profile
@mattcomi
mattcomi / PlaceholderCell.swift
Created August 12, 2021 03:38
A placeholder that expands to fill the remaining screen height
// Created by Matt Comi on 12/8/21.
import SwiftUI
struct HeaderView: View {
var body: some View {
VStack(spacing: 6) {
Text("Stampy").font(.title).foregroundColor(.purple).fontWeight(.heavy)
Text("Your Digital Stamp Collection").font(.footnote).foregroundColor(.secondary)
}
var description: String {
return "\(self.dynamicType)(name: \(name), age: \(age), social: \(social))"
}
class Person : ReflectedStringConvertible {
var name: String
var age: Int
var social: Social
init(name: String, age: Int, social: Social) {
self.name = name
self.age = age
self.social = social
}
public protocol ReflectedStringConvertible : CustomStringConvertible { }
extension ReflectedStringConvertible {
public var description: String {
let mirror = Mirror(reflecting: self)
var str = "\(mirror.subjectType)("
var first = true
for (label, value) in mirror.children {
if let label = label {
struct Social {
var twitter: String
}
struct Person {
var name: String
var age: Int
var social: Social
}
@mattcomi
mattcomi / nicestylegist.css
Last active April 12, 2016 07:25
Add these lines to your site to embed GitHub Gist's with a 'Nice' style.
.gist .blob-num { border-color: rgba(205, 233, 244, 1) !important; border-width: 0 2px 0 0 !important }
.gist .js-file-line-container { margin: 9px 0 0 0 !important; background-color: transparent !important }
.gist .gist-file { border: 0 !important; margin-left: 10px; }
.gist .gist-meta { background-color: transparent !important; color: rgba(0, 0, 0, 0.3) !important; padding-top: 5px !important }
.gist .gist-data { border-bottom: 0 !important }
.gist .gist-meta a:first-child { display: none }
.gist .gist-meta a { color: rgba(0, 0, 0, 0.4) !important }