Skip to content

Instantly share code, notes, and snippets.

View Jack-Adam-Mwanzo's full-sized avatar
🤖
Send me smt

Jack-Adam-Mwanzo

🤖
Send me smt
View GitHub Profile
@AncientJames
AncientJames / pixelmap.py
Created February 28, 2025 02:14
This is the TPC I used to pixel map the Fibrovisor ( https://www.youtube.com/watch?v=zz59e1wWyVc ). It uses rgbmatrix ( https://github.com/hzeller/rpi-rgb-led-matrix ) to light up one pixel at a time, and opencv to record the position of the brightest spot in the frame.
#!/usr/bin/env python
import time
import sys
import getpass
from rgbmatrix import RGBMatrix, RGBMatrixOptions
import cv2 as cv
options = RGBMatrixOptions()
options.hardware_mapping = 'regular'
@jimbrayrcp
jimbrayrcp / Text Field Character Count.swift
Created June 10, 2020 19:18
For Swift UI: a simple text field character counter with return value into another text field.
import SwiftUI
import Combine
class TextCountMgr: ObservableObject {
@Published var counted = "0"
@Published var text = "" {
didSet {
counted = String(text.count)
}
@marslin1220
marslin1220 / RequestPlayground.swift
Last active April 7, 2025 08:06
How to create a HTTP GET request on Swift Playground
import Foundation
import PlaygroundSupport
URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
PlaygroundPage.current.needsIndefiniteExecution = true
// Refer to the example: https://grokswift.com/simple-rest-with-swift/
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todo/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")