- set cookie from foo.example.com with no domain
- is it readable by foo.example.com?
- is it readable by bar.example.com?
- is it overwritable by bar.example.com?
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
var express = require('express'); | |
var app = express(); | |
app.get('/', function(req, res) { | |
res.sendStatus(500); | |
}); | |
app.listen(6969); |
Some functions I have installed in my ~/.bash_profile
to make life easier. Source code
Clone a repo into your projects folder and cd
into it.
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
// | |
// PageSlide.swift | |
// personal-best | |
// | |
// Created by Shaun Donnelly on 20/06/2020. | |
// Copyright © 2020 Shaun Donnelly. All rights reserved. | |
// | |
import SwiftUI |
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 | |
class MyModel: ObservableObject { | |
@Published var segmentedControlValue: Int = 0 { | |
didSet { | |
self.accumulator += 1 | |
print("segmentedControlValue set to \(self.segmentedControlValue)") | |
} | |
} | |
@Published var accumulator: Int = 0 |
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 | |
struct RoundedVStack<Content: View>: View { | |
let content: Content | |
init(@ViewBuilder content: () -> Content) { | |
self.content = content() | |
} | |
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
import SwiftUI | |
struct Heading: View { | |
let title: String | |
let accessoryView: AnyView? | |
init( | |
_ title: String, | |
accessoryView: AnyView? = nil | |
) { |
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
/* | |
Adds an input to bongo.cat so you can preset your own tunes. | |
*/ | |
(() => { | |
const simulateKey = (simKey) => { | |
var instrument = InstrumentPerKeyEnum[simKey.toUpperCase()]; | |
var key = KeyEnum[simKey.toUpperCase()]; | |
if (instrument !== undefined && key !== undefined) { | |
$.play(instrument, key, true); |
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 | |
struct ContentView: View { | |
@State private var showPhotoSheet = false | |
@State private var image: UIImage? = nil | |
var body: some View { | |
VStack { | |
Button(action: { showPhotoSheet = true }) { | |
Label("Choose photo", systemImage: "photo.fill") |
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 Foundation | |
import HealthKit | |
struct WorkoutSplit: Hashable { | |
let label: String | |
let distance: HKQuantity | |
let duration: TimeInterval | |
} | |
extension WorkoutSplit { |