Skip to content

Instantly share code, notes, and snippets.

View dldnh's full-sized avatar

Dave Diamond dldnh

View GitHub Profile
@JohnSundell
JohnSundell / StarPlane.swift
Created July 8, 2020 22:41
A simple game written in SwiftUI. Note that this is just a fun little hack, the code is not meant to be taken seriously, and only works on iPhones in portrait mode.
// A fun little game written in SwiftUI
// Copyright (c) John Sundell 2020, MIT license.
// This is a hacky implementation written just for fun.
// It's only verified to work on iPhones in portrait mode.
import SwiftUI
final class GameController: ObservableObject {
@Published var plane = GameObject.plane()
@Published private(set) var clouds = [GameObject]()
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@eivindml
eivindml / GameDetail.swift
Created September 3, 2019 18:31
SwiftUI ImageLoader with caching
let url = URL(string: "https://mist.eivindml.now.sh/static/Artboard.png")!
struct GameDetail: View {
@State var nowDate = Date()
private var refDate: Date {
let formatter = DateFormatter()
formatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
let rDate = formatter.date(from: "20019-10-11 12:12:12")
return rDate!
@hraban
hraban / pre-commit.md
Last active April 18, 2024 06:46
Prevent accidentally committing debug code in Git
@nicwolff
nicwolff / gist:2925803
Created June 13, 2012 19:00
'tcsh' Git prompt to show current branch
# in ~/bin/gitprompt.csh:
setenv GIT_BRANCH_CMD "sh -c 'git branch --no-color 2> /dev/null' | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'"
set prompt="%m:%~ `$GIT_BRANCH_CMD`%B%#%b "
# and then in ~/.cshrc:
alias precmd "source ~/bin/gitprompt.csh"