def to_bool(string)
if string == true || string == 1 || string =~ (/(true|1)$/i)
true
else
false
end
end
# gruvbox-dark colorscheme for kitty | |
# snazzy theme used as base | |
foreground #ebdbb2 | |
background #272727 | |
selection_foreground #655b53 | |
selection_background #ebdbb2 | |
url_color #d65c0d | |
# black |
dconf write /org/gnome/terminal/legacy/profiles:/:<id>/allow-bold false |
import PropTypes from 'prop-types'; | |
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>; | |
type Defined<T> = T extends undefined ? never : T; | |
/** | |
* Get the type that represents the props with the defaultProps included. | |
* | |
* Alternatively, we could have done something like this: |
I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.
Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.
All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.
class MultipleInstancesOfState | |
attr_accessor :state | |
def initialize(state:) | |
@state = state | |
end | |
def foo | |
@state.reverse! | |
end |
Go to the course and have any video up. The following code relies on the right sidebar to be visible to uncheck all your progress.
You can do this with ctrl+shift+j
and making sure the console
tab is selected for chrome/brave
const toUnixTime = (date) => date.getTime() / 1000; | |
const usageInterval = (start, end) => ({ | |
start: toUnixTime(start), | |
end: toUnixTime(end) | |
}); | |
const getSyndayOfTheWeek = (currentDate) => { | |
const date = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate()); |