This file contains hidden or 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
function hello() { | |
console.log("hi"); | |
} |
This file contains hidden or 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
## Home Assistant OS (Latest as of July 17th, 2021) | |
## Installation using Ubuntu 20.04 Server and KVM | |
## Thanks to: | |
# https://gist.github.com/dsbaars/82a31303f50da08edb422fdc15031257 | |
# https://community.home-assistant.io/t/install-home-assistant-os-with-kvm-on-ubuntu-headless-cli-only/254941 | |
# /var/lib/libvirt/images/hassos-vm | |
## Everything lives here | |
mkdir -vp /var/lib/libvirt/images/hassos-vm && cd /var/lib/libvirt/images/hassos-vm |
This file contains hidden or 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
open BsTinycolor; | |
open Belt; | |
type colorChange = { | |
. | |
"hex": string, | |
"hsl": TinyColor.hsl, | |
"hsv": TinyColor.hsv, | |
"oldHue": float, | |
"rgb": TinyColor.rgb, |
This file contains hidden or 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
# fbd - delete git branch (including remote branches) | |
fbd() { | |
local branches branch | |
branches=$(git for-each-ref --count=30 --sort=-committerdate refs/heads/ --format="%(refname:short)") && | |
branch=$(echo "$branches" | fzf --multi ) && | |
git branch -D $(echo "$branch" | sed "s/.* //" | sed "s#remotes/[^/]*/##") | |
} | |
## place this in your ~/.zshrc and make sure you have fzf installed: brew install fzf |
This file contains hidden or 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
type action = Toggle | Close | Edit; | |
let reducer = switch(action) { | |
| Toggle => "toggle visibility" | |
| Close => "close me" | |
| Edit => "edit function" | |
}; |
This file contains hidden or 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
let (result) = useQuery(ComponentList.definition); | |
switch(result) { | |
| Loading => <LoadingSpinner /> | |
| Error(err) => <ErrorMessage message={err##message} /> | |
| Data(data) => { | |
switch(data##componentsList) { | |
| None => [] | |
| Some(components) => components->Belt.Array.map(component => <div> component##value </span> | |
} |
This file contains hidden or 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
[@genType] | |
let make = (~render, ~children) => { | |
...component, | |
render: _self => | |
<div className="InteriorLayout"> | |
{render()} | |
</div>, | |
}; |
This file contains hidden or 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
document.body.style.backgroundColor = 'black' |
This file contains hidden or 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 * as React from "react"; | |
import hoistNonReactStatics from 'hoist-non-react-statics'; | |
import { View, ActivityIndicator } from "react-native"; | |
const withLoadingScreen = (size = "small") => WrappedComponent => { | |
class LoadingScreen extends React.PureComponent { | |
render() { | |
if (this.props.loading) return <ActivityIndicator size={size} color="white" /> | |
return <WrappedComponent {...this.props} />; | |
} |