Skip to content

Instantly share code, notes, and snippets.

Avatar
🌱
Developing a new macOS app.

Eivind Lindbråten eivindml

🌱
Developing a new macOS app.
View GitHub Profile
View timer-effect.patch
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 Sep 3, 2019
SwiftUI ImageLoader with caching
View GameDetail.swift
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!
View cubesanddiamonds.pde
//
// 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 Nov 6, 2019
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…
View PointFreeStateManagement.swift
// 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 Dec 11, 2019
Example of how to get Dynamic Type with custom fonts in SwiftUI
View SwiftUI+CustomFonts+DynamicType.swift
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 Nov 12, 2018 — forked from matux/scntool.md
SceneKit scntool command line options
View scntool.md
$ 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 Jun 16, 2022
SceneKit scntool command line options
View scntool.md
$ 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 Sep 12, 2017
Docker - Replacing Apache DocumentRoot using `sed`.
View Docker - Replacing Apache DocumentRoot using `sed`.md
   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 Mar 16, 2022
On macOS: Install pygmentize and alias pcat for shell code syntax highlighting
View pcat-install.sh
# 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
Minimalist CSS grid, using new CSS grid property. 🏁 Check compatibility before use.
View grid.sass
.l-wrap
width: 100%
max-width: 1196px
margin: 0 auto
.l-grid
display: grid
grid-gap: 52px
grid-template-columns: repeat(6, 1fr)