This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct UIDurationField: UIViewRepresentable { | |
func makeUIView(context: Context) -> UITextField { | |
let coordinator = context.coordinator | |
let textField = PaddedTextField() | |
textField.delegate = coordinator | |
textField.backgroundColor = MyUIColor.textFieldBackground | |
textField.textAlignment = .center | |
textField.keyboardType = .numberPad | |
textField.placeholder = "00" + String(coordinator.separator) + "00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat settings.gradle | sed -n -e 's/rootProject\.name = '\''\(.*\)'\''/\1/p' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# zstyle : Instructs the shell on how to provide inline, | |
# contextual hints | |
# fpath : The git-completion.zsh is a function file, | |
# not designed to be sourced like the bash script. | |
# This command appends the ~/.zsh directory onto | |
# the shell’s function lookup list. | |
# autoload : Scan each path within the fpath variable for | |
# files starting with an underscore (_git , in our | |
# case) and loads the corresponding script as a | |
# function file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '("uuidgen" | getline uuid) > 0 {print $0, uuid} {close("uuidgen")}' output.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func makeSelectedBackgroundView() -> UIView { | |
let view = UIView() | |
view.backgroundColor = Color.selectedCell | |
return view | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gawk -F '"' '{code=gensub(" ", "_", "g", $2); print $1 "\x22"$2"\x22,", "code: \x22" tolower(code) "\x22" $3}' activity_list.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:r !uuidgen|sed 's/.*/"uuid": "&",/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard let interval = calendar.dateInterval(of: .month, for: Date()) else { return } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
class DateUtil { | |
private init() { | |
} | |
static func currentWeek() -> Int { | |
let calendar = NSCalendar.current | |
let dateComponent = calendar.component(Calendar.Component.weekOfYear, from: Date()) | |
return dateComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# usage: ./find-class.sh <path> <class name> | |
find "$1" -name "*.jar" -exec sh -c 'jar tf {} | grep -H --label {} '$2'' \; |
NewerOlder