Skip to content

Instantly share code, notes, and snippets.

View gnperdue's full-sized avatar
👋

Gabriel Perdue gnperdue

👋
View GitHub Profile
@gnperdue
gnperdue / ns-cheatsheet.clj
Created February 2, 2016 03:24 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gnperdue
gnperdue / IntegerTextField.swift
Created January 14, 2021 01:05 — forked from grosch/IntegerTextField.swift
SwiftUI TextField which only accepts integers and binds to an Int? instead of a String
import SwiftUI
private class IntegerTextFieldValue: ObservableObject {
@Published var value = "" {
didSet {
let numbersOnly = value.filter { $0.isNumber }
if value != numbersOnly {
value = numbersOnly
}
}