I hereby claim:
- I am burntcaramel on github.
- I am burntcaramel (https://keybase.io/burntcaramel) on keybase.
- I have a public key ASArnj22CZ7v-9tbcz-52hippT2ZfvGy4dQ3ZoSelHe3lwo
To claim this, I am signing this object:
protocol Actor : AnyObject, Sendable { | |
associatedtype State | |
isolated var state: State | |
} | |
struct BankAccountState { | |
var balance: Double | |
mutating func deposit(amount: Double) { |
import { parse } from "./index"; | |
test("parse()", () => { | |
test.each([ | |
['Monday', { weekdays: new Set(['monday']) }], | |
['Wednesday', { weekdays: new Set(['wednesday']) }], | |
[' Wednesday ', { weekdays: new Set(['wednesday']) }], | |
['Wednesday and Saturday', { weekdays: new Set(['wednesday', 'saturday']) }], | |
['Wednesday or Saturday', { weekdays: new Set(['wednesday', 'saturday']) }], | |
['Wednesday, Saturday', { weekdays: new Set(['wednesday', 'saturday']) }], |
const pedestrianStates = { | |
initial: 'walk', | |
states: { | |
walk: { | |
on: { | |
PED_COUNTDOWN: 'wait' | |
} | |
}, | |
wait: { | |
on: { |
I hereby claim:
To claim this, I am signing this object:
interface State { | |
counter: number | |
} | |
const counterModel = { | |
initial(): State { | |
return { | |
counter: 0 | |
}; | |
}, |
//: Playground - noun: a place where people can play | |
import Foundation | |
struct ExampleStruct : Codable { | |
var title: String | |
var something: Int | |
public func encode(to encoder: Encoder) throws { |
FROM ruby:2.4-alpine | |
ENV PATH /root/.yarn/bin:$PATH | |
RUN apk update && apk upgrade && \ | |
apk add --no-cache bash git openssh build-base nodejs tzdata | |
RUN apk update \ | |
&& apk add curl bash binutils tar gnupg \ | |
&& rm -rf /var/cache/apk/* \ |
public struct Person { | |
public var firstName: String | |
public var middleName: String? | |
public var lastName: String | |
public var ageInYears: Int | |
public var fullName: String { | |
return [firstName, middleName, lastName].flatMap{ $0 }.joinWithSeparator(" ") | |
} | |
} |
//: Responder chain in Swift using enums | |
protocol CommandProtocol {} | |
protocol Responder: class { | |
var nextResponder: Responder? { get } | |
func performerForCommand | |
<Command : CommandProtocol> | |
(command: Command) -> (() -> ())? |
struct Person { | |
var firstName, lastName: String | |
mutating func makeScottishClan() { | |
lastName = "mc\(lastName)" | |
} | |
} | |
// Person.Mutation gets automatically created (like an enum) | |
// .firstName(String) |