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 | |
@Observable class Account { | |
var name: String = "Foo" | |
} | |
// What is the right way to get a Binding to a property of an Environment object? | |
struct AccountEditor: View { | |
@Environment(Account.self) var account |
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
machine and then add the last few cells with selected cells. | |
That's how I kind of think to do, maybe do something with maybe two or three antibodies with that scenario. | |
That way it's like a type and screen on a patient. | |
They get your screen results from the analyzer. | |
Then they get their panel result from the analyzer 'cause that's pretty typical. |
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 | |
@MainActor | |
class KeyboardMonitor: ObservableObject { | |
@Published var modifierFlags: NSEvent.ModifierFlags = NSEvent.modifierFlags | |
private var monitor: Any? = nil | |
private init() { | |
monitor = NSEvent.addLocalMonitorForEvents(matching: [.flagsChanged]) { event in | |
self.modifierFlags = event.modifierFlags |
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
struct MatrixItem: Codable, Identifiable, Hashable { | |
var id: UUID = UUID() | |
let name: String | |
let rooms: [MatrixItem]? | |
} | |
struct ContentView: View { | |
@State private var demoState: [MatrixItem] = [] | |
var body: some View { |
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
tell application "Mail" | |
set theCutoff to (current date) - (14 * days) | |
with timeout of 6000 seconds | |
set theMessages to every message of inbox where (date sent < theCutoff) | |
end timeout | |
repeat with theMessage in theMessages | |
try | |
set theMessage to contents of theMessage | |
set theDate to date sent of theMessage | |
set theBoxName to "Inbox/Inbox " & (year of theDate) & "-" |
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
# Based on https://edi.wang/post/2018/12/21/automate-windows-10-developer-machine-setup | |
# and https://github.com/EdiWang/EnvSetup/ | |
Set-ExecutionPolicy RemoteSigned | |
function Check-Command($cmdname) { | |
return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue) | |
} | |
Write-Host "" |
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 FluentPostgresDriver | |
import FluentSQLiteDriver | |
// This extension adds transaction support to the Database protocol. | |
// It has to be specialized for each Database type used by your application, | |
// since the Database protocol does not support the raw() method. | |
extension Database { | |
func transaction(callback: @escaping (Database) -> EventLoopFuture<Void>) -> EventLoopFuture<Void> { | |
return self.withConnection { (db) -> EventLoopFuture<Void> in |
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
<html> | |
<head> | |
<!--Load the AJAX API--> | |
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
// Load the Visualization API and the corechart package. | |
google.charts.load('current', {'packages':['corechart']}); | |
// Set a callback to run when the Google Visualization API is loaded. |
This file has been truncated, but you can view the full file.
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
#YY MM DD hh mm WDIR WSPD GST WVHT DPD APD MWD PRES ATMP WTMP DEWP VIS PTDY TIDE | |
#yr mo dy hr mn degT m/s m/s m sec sec degT hPa degC degC degC nmi hPa ft | |
2019 01 24 19 48 170 15.4 17.5 MM MM MM MM 991.5 10.8 MM 10.8 1.4 MM MM | |
2019 01 24 19 42 170 13.9 16.0 MM MM MM MM 991.7 10.7 MM 10.7 1.2 MM MM | |
2019 01 24 19 36 170 11.8 19.0 MM MM MM MM 992.2 10.7 MM 10.7 1.2 MM MM | |
2019 01 24 19 30 180 15.4 18.0 MM MM MM MM 992.6 11.4 MM 11.4 1.2 MM MM | |
2019 01 24 19 24 180 15.4 20.6 MM MM MM MM 992.9 11.0 MM 11.0 1.3 MM MM | |
2019 01 24 19 18 180 16.5 20.6 MM MM MM MM 993.2 11.2 MM 11.2 1.4 MM MM | |
2019 01 24 19 12 180 16.0 19.0 MM MM MM MM 993.6 11.1 MM 11.1 2.2 MM MM | |
2019 01 24 19 06 180 16.0 19.6 MM MM MM MM 993.8 11.0 MM 11.0 1.5 MM MM |
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
Imports System.Data.Entity | |
Imports System.Data.Entity.Migrations | |
Public Class DropCreateAndSeed(Of TContext As DbContext, TMigrationConfiguration As {DbMigrationsConfiguration(Of TContext), New}) | |
Implements IDatabaseInitializer(Of TContext) | |
Public Sub InitializeDatabase(context As TContext) Implements IDatabaseInitializer(Of TContext).InitializeDatabase | |
Dim step1 = New DropCreateDatabaseAlways(Of TContext)() | |
step1.InitializeDatabase(context) |
NewerOlder