Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
import Combine
struct FlightBookingView: View {
@ObservedObject var model: FlightBookingViewModel
var body: some View {
NavigationView {
Form {
DatePicker(selection: $model.departureDate, in: model.departureDateRange, displayedComponents: .date) {
@webcpu
webcpu / exercism-downloader.py
Last active October 14, 2018 08:25
Download all of the exercism ReasonML projects and install the npm packages. (macOS)
#!/usr/local/bin/python3
import os
import subprocess
import json
from os.path import expanduser
home = expanduser("~")
track = 'reasonml'
projects = ['protein-translation', 'armstrong-numbers', 'change', 'rna-transcription', 'space-age', 'bob', 'anagram', 'accumulate', 'run-length-encoding', 'minesweeper', 'hello-world', 'leap', 'isogram', 'raindrops', 'acronym', 'word-count', 'allergies', 'all-your-base', 'pangram', 'binary-search']
@webcpu
webcpu / monitor.py
Last active June 28, 2019 21:28
Reboot ethOS when any miner's hash rate is too low.
#!/usr/bin/env python3
import os
# 1. Save this file in /home/ethos/monitor.py on your ethOS
# 2. Change permission to make it executable
# chmod 0755 /home/ethos/monitor.py
# 3. Run crontab
# # crontab -e
# 4. Schedule a cron task to execute every 5 minutes
"""