Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View twof's full-sized avatar
💧

Alex Reilly twof

💧
View GitHub Profile
import SwiftUI
import ComposableArchitecture
@Reducer
struct Scroll {
@ObservableState
struct State {
var scrollPosition: Double
var trackerId: String?
}

Everything that happens in tick_ship

  • Check if there is a crash message
    • If there is
      • Show debug text on screen
      • Play ship explosion animation
  • The gas usage count is reset
  • Previously the WASM instance had a portion of it's memory sectioned off to store ship state
  • // TODO: I'm not super clear on what select_submemory does, but I assume that means we're operating on the ship's state from here on out
  • generate_system_state is called. state is passed to the function and updated by the function.
  • Write state to the ship's system state slice of memory

Curl GraphQL

Search used: curl "\"query\": \"{" OR "\"query\": \"query" language:Shell

Results: 342

Learnings

There are a few common use cases you'll see in the examples that do no parsing

A significant amount of press (a selection that is by no means exhaustive has been linked below) has been given to companies and organizations that are doing 4 day/8 hour work weeks without a change in compensation. Organizations that adopted a 4 day work week experienced

  • Sustained or improved productivity.
  • Worker happiness increased dramatically.
  • Stress, burnout and turnover decreased.
  • Companies had an easier time attracting and retaining talent.
  • Customer outcomes improved.
  • Number of sick days declined.
  • Carbon footprints could be reduced significantly.
// Query
{
user {
cat? {
name!
age
}
}
}
@twof
twof / ReflectiveDecodable.swift
Created March 3, 2018 05:46
Codable that automatically decodes with default vals
import Foundation
func iterateEnum<T: Hashable>(_: T.Type) -> AnyIterator<T> {
var i = 0
return AnyIterator {
let next = withUnsafeBytes(of: &i) { $0.load(as: T.self) }
if next.hashValue != i { return nil }
i += 1
return next
}
extension Binding: Sequence where Value == Array<Track> {
public typealias Iterator = IndexingIterator<Array<Binding<Track>>>
public __consuming func makeIterator() -> IndexingIterator<Array<Binding<Track>>> {
return IndexingIterator(_elements: (0..<wrappedValue.count).map { projectedValue[$0] })
}
}
extension Binding: Collection where Value == Array<Track> {
public typealias Element = Binding<Track>
extension Binding where Value == Array<Track> {
var boundItems: Array<Binding<Track>> {
return (0..<wrappedValue.count).map { projectedValue[$0] }
}
}
@twof
twof / Test.js
Last active June 24, 2020 04:47
console.log("hello world")
// This is a comment to add more lines
// Another line to demonstrate an edit
(lldb) call UnsafeMutablePointer<[HTTPCookie]>.allocate(capacity: 1)
(UnsafeMutablePointer<[HTTPCookie]>) $R0 = 0x00007f7f89c16380
(lldb) call cookieStore.getAllCookies { cs in $R0.initialize(to: cs); print("Done") }
(lldb) call RunLoop.main.run(mode: .common, before: Date())
(Bool) $R4 = false
(lldb) call RunLoop.main.run(mode: .common, before: Date())
(Bool) $R6 = false
(lldb) call RunLoop.main.run(mode: .common, before: Date())
(Bool) $R8 = false
(lldb) call RunLoop.main.run(mode: .common, before: Date())