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 logging | |
import crayons | |
# Define logging colors here | |
LOGGING_STYLES = { | |
'debug': {'color': 'white', 'bold': False}, | |
'info': {'color': 'green', 'bold': True}, | |
'warning': {'color': 'magenta', 'bold': True}, | |
'error': {'color': 'yellow', 'bold': True}, |
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 RealmSwift | |
extension Object { | |
// Update property value in Realm | |
func update(_ property: String, value: Any?) { | |
let realm = try! Realm() | |
try! realm.write { | |
self.setValue(value, forKey: property) | |
} | |
} |
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/bash | |
# Add a new note (format: markdown with Jekyll-like front matter) | |
# Usage: addnote.sh title category | |
# Author: herrkaefer ([email protected]) | |
# Root directory of notes | |
notesdir="/Users/herrk/Dropbox/Notes" | |
# title is required | |
if [ -z "$1" ] |