Skip to content

Instantly share code, notes, and snippets.

@Mattihew
Mattihew / git
Last active May 18, 2026 00:21
Git wrapper to forward to git.exe from WSL
#!/usr/bin/env bash
script_file="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/git"
fallback_git="$(which -a git | grep -m 1 -A 1 "$script_file" | tail -n 1)"
if [[ "$WSL_DISTRO_NAME" == "" || "${@: -1}" == "--help" ]]; then
$fallback_git "$@"
else
replacedArgs=()
nextIsC=1
fs="$(df --output='fstype' "$PWD" | tail -n '+2')"
subcommand=""
@Mattihew
Mattihew / press-button-turn-on-off-entities.yaml
Last active September 10, 2024 01:23 — forked from Blackshome/press-button-turn-on-off-entities.yaml
press-button-turn-on-off-entities.yaml
blueprint:
name: Press Button - Turn ON & OFF Entities
description: >
# 🧿 Press Button - Turn ON & OFF Entities
**Version: 1.0**
Let us know what you think of this blueprint and for community support including updates: [Click Here](https://community.home-assistant.io/t/press-button-turn-on-off-entities/634488)
const onClickOut = () => console.log("clicked!");
useEffect(() => {
document.addEventListener("click", onClickOut, true);
return () => {
document.removeEventListener("click", onClickOut, true);
};
}, [onClickOut]);
type Color = [number, number, number];
interface Mask {
name: string;
releaseYear: number;
maker: string;
color: Color;
}
const data: Mask[] = [
@Mattihew
Mattihew / enumString.java
Last active October 22, 2016 16:38
returning Strings from enum
public enum EnumStrings{
enum1("String1"),
enum2("String2");
private String stringValue;
/**
* Constructor.
*/
private EnumStrings(String stringValue)