Skip to content

Instantly share code, notes, and snippets.

@schtibe
schtibe / i3_screenshot_config
Last active August 8, 2023 23:27
Screenshot keybindings with i3 and scrot that are copied to the clipboard
bindsym Print exec "scrot -e 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'"
bindsym $mod+Print --release exec "scrot -ue 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'; sleep 1; exec notify-send 'screenshot has been saved to ~/tmp'"
bindsym $mod+Shift+Print --release exec "notify-send 'selection will be saved to ~/tmp'; scrot -se 'mv $f ~/tmp && xclip -selection clipboard -t image/png -i ~/tmp/$n'"
@schtibe
schtibe / tw-config-in-code.js
Created September 11, 2023 20:18
Use tailwind config in code
import tailwindConfig from "../../tailwind.config";
import resolveConfig from "tailwindcss/resolveConfig";
const config = resolveConfig(tailwindConfig);
@schtibe
schtibe / foo.vue
Last active October 23, 2023 15:27
Ignoring stuff
<template>
<!-- eslint-disable-next-line vue/no-v-html -->
<something-for-eslint />
{{
//@ts-ignore
formattedDate(collection[index].datetime)
}}</span
</template>
@schtibe
schtibe / switch-branch.sh
Last active February 1, 2024 12:37
Git switch branch helper
#!/bin/bash
git fetch > /dev/null
# Get the list of branches from "git branch -a" using fzf for interactive selection
selected_branch=$(git branch -a | grep -v HEAD | sed 's/^[[:space:]]*//' | fzf --ansi --prompt="Select a branch (Use arrow keys): ")
if [ -n "$selected_branch" ]; then
if [ "$selected_branch" == "Exit" ]; then
echo "Exiting..."