Skip to content

Instantly share code, notes, and snippets.

@epaga
epaga / TappableView.swift
Last active December 13, 2021 17:57
SwiftUI View for getting taps with(!) the tap locations unlike the current tapAction and tapGestures of SwiftUI
// SwiftUI View for getting taps with(!) the tap locations unlike the current tapAction and tapGestures of SwiftUI
// There may be a way easier way to do this, not sure...
/*
Use like so:
TappableView {
(location, taps) in
if taps == 1 {
print("single tap at \(location)")
@snoyes
snoyes / update field.py
Last active September 10, 2023 14:20
Anki: move part of field to different field, or remove unwanted content from a field
# Open the debug console with Ctrl+: (which is Ctrl+Shift+; on US keyboards)
# (Don't have the browser window open when you do.)
# Run it with Ctrl+Enter
# Remove the # from the last line to actually save the changes
s = r'regular expression to search for goes here'
srcField = 'Source Field Name goes here'
tgtField = 'Target Field Name goes here'
noteType = 'Name of the Note Type goes here'