Skip to content

Instantly share code, notes, and snippets.

View eivindml's full-sized avatar
🌱
Developing a new macOS app.

Eivind Lindbråten eivindml

🌱
Developing a new macOS app.
View GitHub Profile
diff --git a/0084-testable-state-management-ergonomics/PrimeTime/ComposableArchitecture/ComposableArchitecture.swift b/0084-testable-state-management-ergonomics/PrimeTime/ComposableArchitecture/ComposableArchitecture.swift
index db4ab12..ab96c5f 100644
--- a/0084-testable-state-management-ergonomics/PrimeTime/ComposableArchitecture/ComposableArchitecture.swift
+++ b/0084-testable-state-management-ergonomics/PrimeTime/ComposableArchitecture/ComposableArchitecture.swift
@@ -128,3 +128,24 @@ public func logging<Value, Action>(
}] + effects
}
}
+
+
@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!
@marcedwards
marcedwards / cubesanddiamonds.pde
Last active October 25, 2021 06:40
Cubes and diamonds
//
// Cubes and diamonds.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1167765622899347459
//
@cdmcmahon
cdmcmahon / PointFreeStateManagement.swift
Last active November 6, 2019 23:51
In the Point-Free series on application architecture and state management, they define a series of ways to compose reducers. Sometimes, however, it seems that the signature of reducers can complicate the signature of these different compositions. I found creating a typealias for reducers separated the concern of understanding the concept of redu…
// In the Point-Free series on application architecture and state management,
// they define a series of ways to compose reducers. Sometimes, however, it seems
// that the signature of reducers can complicate the signature of these different
// compositions. I found creating a typealias for reducers separated the concern of
// understanding the concept of reducers and understanding their higher order
// constructions, especially when starting to write my own.
// Adding a typealias for Reducer can make certain parts a bit more readable
typealias Reducer<Value, Action> = (inout Value, Action) -> Void
@simonliotier
simonliotier / SwiftUI+CustomFonts+DynamicType.swift
Last active December 11, 2019 14:27
Example of how to get Dynamic Type with custom fonts in SwiftUI
import SwiftUI
/// Example of how to get Dynamic Type with custom fonts in SwiftUI.
struct ContentView: View {
var body: some View {
VStack(spacing: 20) {
Text("A large title").customFont(.largeTitle) // "Optima-ExtraBlack", 28
Text("A body").customFont(.body) // "Kailasa", 16
Text("A caption").customFont(.caption2) // "IowanOldStyle-Italic", 11
}
@eivindml
eivindml / scntool.md
Created November 12, 2018 11:57 — forked from matux/scntool.md
SceneKit scntool command line options
$ xcrun scntool --verbose
| Current SceneKit version is 4.560000
| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]
000084a8:  7363 7269 7074 696f 6e00 2d2d 7461 7267 6574 2d70 6c61 7466  :scription.--target-platf
@matux
matux / scntool.md
Last active April 11, 2023 13:49
SceneKit scntool command line options
$ xcrun scntool --verbose
| Current SceneKit version is 4.560000
| Running scntool (compiled on Jul  1 2018 01:01:55)

usage: scntool --convert file --format format [--output file]
000084a8:  7363 7269 7074 696f 6e00 2d2d 7461 7267 6574 2d70 6c61 7466  :scription.--target-platf
@oviniciusfeitosa
oviniciusfeitosa / Docker - Replacing Apache DocumentRoot using `sed`.md
Created September 12, 2017 22:02
Docker - Replacing Apache DocumentRoot using `sed`.
   ENV APACHE_DOCUMENT_ROOT /var/www/mapasculturais/src

   RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
   RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
@BretFisher
BretFisher / pcat-install.sh
Last active February 6, 2024 14:41
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
# first install pygmentize to the mac OS X or macOS system with the built-in python
sudo easy_install Pygments
# then add alias to your ~/.bash_profile or ~/.bashrc or ~/.zshrc etc.
alias pcat='pygmentize -f terminal256 -O style=native -g'
@eivindml
eivindml / grid.sass
Created May 14, 2017 08:48
Minimalist CSS grid, using new CSS grid property. 🏁 Check compatibility before use.
.l-wrap
width: 100%
max-width: 1196px
margin: 0 auto
.l-grid
display: grid
grid-gap: 52px
grid-template-columns: repeat(6, 1fr)