Skip to content

Instantly share code, notes, and snippets.

View mheob's full-sized avatar
🚀
AWESOME 🤘

Alex Böhm mheob

🚀
AWESOME 🤘
View GitHub Profile
@mheob
mheob / github-labels.json
Created May 1, 2023 13:39
My default GitHub labels
[
{ "name": "Priority: Medium", "color": "ffda20" },
{ "name": "Priority: High", "color": "ff9920" },
{ "name": "Priority: Critical", "color": "fb4344" },
{ "name": "Type: Bug", "color": "fb4344" },
{ "name": "Type: Maintenance", "color": "ffda20" },
{ "name": "Type: Feature", "color": "208bff" },
{ "name": "Type: Question", "color": "f55794" },
{ "name": "good first issue", "color": "c260fb" },
{ "name": "help wanted", "color": "3be68d" }
@mheob
mheob / brew-bundle-brewfile-tips.md
Created November 22, 2022 16:08 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@mheob
mheob / helpful-snippets.js
Last active September 1, 2022 13:50
JS - Helpful Snippets
// Detect if dark mode
const isDarkMode = () => globalThis.matchMedia?.("(prefers-color-scheme:dark)").matches ?? false;
isDarkMode();
// ---------------------------------------------------------------
@mheob
mheob / use-toggle.ts
Created October 19, 2021 07:55
Simple `useToggle` hook which returns the boolean state and the setter methods `on`, `off`, `toggle` and `reset`.
import { useState } from 'react'
export function useToggle(
initialState = false
): [boolean, { on: () => void; off: () => void; toggle: () => void; reset: () => void }] {
const [state, setState] = useState(initialState)
const handlers = {
on: () => {
setState(true)
},
@mheob
mheob / post-merge.sh
Created February 8, 2021 15:46
100HERZ - Craft CMS - Git Hook - post merge
#!/usr/bin/env bash
# git hook to run a command after `git pull` if a specified file was changed
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
echo "Checking yarn.lock ..."
@mheob
mheob / jsx.yaml
Last active February 8, 2021 15:48
Simple (plain) JSX and TSX syntax for the micro editor https://github.com/zyedidia/micro
# ~/.config/micro/syntax/jsx.yaml
filetype: jsx
detect:
filename: "\\.jsx$"
rules:
- include: "javascript"