Skip to content

Instantly share code, notes, and snippets.

View tunchamroeun's full-sized avatar

Tun Cham Roeun tunchamroeun

  • CloudWare Center
  • Cambodia
View GitHub Profile
live_config_reload: true
window:
opacity: 0.85
padding:
x: 18
y: 16
dynamic_padding: false
decorations: buttonless
@michaelhenry
michaelhenry / HasRootNavigationController.swift
Last active June 7, 2025 07:12
UINavigationController in swiftUI.
import SwiftUI
import UIKit
protocol HasRootNavigationController {
var rootVC:UINavigationController? { get }
func push<Content:View>(view: Content, animated:Bool)
func setRootNavigation<Content:View>(views:[Content], animated:Bool)
func pop(animated: Bool)
func popToRoot(animated: Bool)
@neelbhanushali
neelbhanushali / usb-connected-hand-held-barcode-scanner-input.js
Last active December 30, 2024 15:04
Javascript for detecting usb connected - hand held - barcode scanner input
// Author: Neel Bhanushali <neal.bhanushali@gmail.com>
document.addEventListener('keydown', function(e) {
// add scan property to window if it does not exist
if(!window.hasOwnProperty('scan')) {
window.scan = []
}
// if key stroke appears after 10 ms, empty scan array
if(window.scan.length > 0 && (e.timeStamp - window.scan.slice(-1)[0].timeStamp) > 10) {
window.scan = []
@29satnam
29satnam / RealmExample.swift
Last active February 7, 2022 04:27
Realm CRUD Swift 5
import UIKit
import RealmSwift
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let realm = try! Realm()