I hereby claim:
- I am rickwierenga on github.
- I am rickwierenga (https://keybase.io/rickwierenga) on keybase.
- I have a public key ASAkU1wNIrNLPYFbhssi8Vh5kkrEOrxsapKJrH9Hfh2mLAo
To claim this, I am signing this object:
| import sys | |
| def indent_code(code, spaces=2): | |
| """Indents each line of the provided code.""" | |
| indentation = " " * spaces | |
| return "\n".join(f"{indentation}{line}" if line.strip() else line for line in code.splitlines()) | |
| def wrap_in_async_main(file_path): | |
| """Reads a file, wraps its content in an async def main() block, and appends the if __name__ == '__main__' block.""" | |
| try: |
| # usage: python srtfinder.py filename.rst your quote | |
| # requires https://pypi.org/project/srt/ | |
| # can be memory optimized by discarding failed 'read' chars and resetting 'widx' | |
| import srt | |
| import sys | |
| print(sys.argv[1]) | |
| with open(sys.argv[1], "r") as f: data = f.read() | |
| p = list(srt.parse(data)) |
| def gcd(x: int, y: int): | |
| while(y): | |
| x, y = y, x % y | |
| return x | |
| def frac(a: int, b: int): | |
| return '\\seqsplit{' + str(a//gcd(a, b)) + '\\div' + str(b//gcd(a,b)) + '}' | |
| def func(a, n): | |
| """ x=a/2**n, f(x) = x^3+3x-2 """ |
I hereby claim:
To claim this, I am signing this object:
| :set number | |
| set expandtab | |
| set shiftwidth=4 | |
| set softtabstop=4 | |
| if &compatible | |
| set nocompatible | |
| endif | |
| set runtimepath+=/Users/rickwierenga/.vim/bundle/neobundle.vim/ |
| // MARK: - Vision | |
| func processClassification(for request: VNRequest) { | |
| // TODO: Extract payload | |
| } |
| lazy var detectBarcodeRequest: VNDetectBarcodesRequest = { | |
| return VNDetectBarcodesRequest(completionHandler: { (request, error) in | |
| guard error == nil else { | |
| self.showAlert(withTitle: "Barcode Error", message: error!.localizedDescription) | |
| return | |
| } | |
| self.processClassification(for: request) | |
| }) | |
| }() |
| import Vision |
| view.subviews.compactMap({ $0 as? UITextField }).forEach { textfield in | |
| if let text = textfield.text, text.isEmpty { | |
| textfield.backgroundColor = .yellow // highlight | |
| } else { | |
| textfield.backgroundColor = .white // default | |
| } | |
| } |
| import UIKit | |
| extension UIImage { | |
| static let home = UIImage(named: "Home") | |
| static let bell = UIImage(named: "Bell") | |
| } |