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 | |
# Helper function for error checking and user-friendly messages | |
exit_if_fail() { | |
local exit_code=$? | |
local message=$1 | |
if [ $exit_code -ne 0 ]; then | |
echo "Error: $message" | |
exit $exit_code | |
fi |
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 { Observable } from 'rxjs'; | |
const createInput = (acceptType: string) => { | |
const input = document.createElement('input'); | |
input.type = 'file'; | |
input.accept = `.${acceptType}`; | |
input.style.display = 'none'; | |
return input; | |
}; |
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
const { language = 'en-US' } = navigator; | |
const formatter = new Intl.RelativeTimeFormat(language, { | |
numeric: 'auto', | |
style: 'long', | |
}); | |
export function formatRelative(when) { | |
const ms = when - Date.now(); | |
const years = Math.ceil(ms / 31536e6); |
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
//// npm install --save roboto-fontface material-icons | |
//// put the below stuff into src/styles.scss | |
// for npm roboto-fontface package (to load local files) | |
$roboto-font-path: "~roboto-fontface/fonts" !default; | |
@import "~roboto-fontface/css/roboto/sass/roboto-fontface"; | |
// for npm material-icons package (to load local files) | |
$material-icons-font-path: '~material-icons/iconfont/'; |