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 _bleio | |
import adafruit_ble | |
from adafruit_ble.advertising.standard import Advertisement | |
from adafruit_ble.services.standard.device_info import DeviceInfoService | |
from adafruit_ble import Service | |
from adafruit_ble.characteristics import Characteristic | |
from adafruit_ble.characteristics.int import Uint16Characteristic | |
from adafruit_ble.uuid import VendorUUID |
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 board | |
import os | |
import time | |
from adafruit_ble import Service | |
from adafruit_ble import BLERadio | |
from adafruit_ble.advertising import Advertisement | |
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement | |
from adafruit_ble.characteristics import Characteristic |
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
/** | |
The idea is to be able to invoke `ReminderDetailsWrapper` (forgive the naming, it’s | |
the result of the organic growth of this thing) with either the ID of an object to edit, | |
or nil, in which case it will create a new one. In both cases, it has to create a new | |
`ModelContext` on which to make the changes, and it only saves if the user taps the | |
“Save” button. | |
Some of thie could be improved if things could be loaded in `init()`, but that gets | |
called far too often as SwiftUI rebuilds the view hierarchy. | |
*/ |
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 AsyncAlgorithms | |
import SwiftUI | |
/** | |
This example shows one possible way to debounce changes from a user typing into a field. | |
*/ | |
struct | |
DebouncedTextView : 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
const char sAddrBus[] = { 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52 }; | |
const char sDataBus[] = { 39, 41, 43, 45, 47, 49, 51, 53 }; | |
#define qPinClock 2 | |
#define qPinRW 3 | |
const uint8_t sROM[] = | |
{ | |
//00 0xFEFF |
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 Vapor | |
/** | |
Convenience extensions to allow writing route handlers that return a tuple | |
of `(HTTPStatus, Content)`, so it’s easier to control the response status. | |
*/ |
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
// | |
// DynamicallyConfigurableLogHandler.swift | |
// | |
// | |
// Created by Rick Mann on 2022-08-04. | |
// | |
import Logging | |
import Foundation |
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
#!/usr/bin/env swift sh | |
/** | |
This Swift script requires that you have [swift-sh](https://github.com/mxcl/swift-sh) installed: | |
``` | |
$ brew install swift-sh | |
``` | |
My CPU differs from Bean Eater’s, in that I program two different ROMs, |
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 CurveEditor: View { | |
var body: some View | |
{ | |
GeometryReader { geom in | |
let width = geom.width // Make the rest of the code a bit cleaner | |
let height = geom. height | |
Path { path in | |
path.move(to: CGPoint(x: 10.0, y: 10.0)) | |
path.addLine(to: CGPoint(x: geom.size.width - 10.0, y: geom.size.height - 10.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
.section __TEXT,__text,regular,pure_instructions | |
.build_version macos, 11, 0 sdk_version 11, 3 | |
.globl _main | |
.p2align 4, 0x90 | |
_main: | |
.cfi_startproc | |
pushq %rbp | |
.cfi_def_cfa_offset 16 | |
.cfi_offset %rbp, -16 | |
movq %rsp, %rbp |
NewerOlder