Skip to content

Instantly share code, notes, and snippets.

@DanielLemky
DanielLemky / input.lua
Last active September 24, 2026 11:41
Mac-like trackpad tuning for Omarchy on an Apple Silicon MacBook Pro
-- Add these settings to ~/.config/hypr/input.lua on Omarchy.
hl.config({
input = {
touchpad = {
natural_scroll = true,
tap_to_click = true,
disable_while_typing = true,
tap_and_drag = false,
drag_lock = false,
clickfinger_behavior = true,
import {
clientEntry,
css,
on,
ref,
type Handle,
type SerializableValue,
} from "remix/ui"
import { theme } from "remix/ui/theme"
@Brayden
Brayden / drive.sh
Created January 27, 2026 15:15
Mounted R2 Drive
#!/usr/bin/env bash
set -euo pipefail
bold() { printf "\033[1m%s\033[0m\n" "$*"; }
info() { printf "• %s\n" "$*"; }
warn() { printf "\033[33m! %s\033[0m\n" "$*"; }
err() { printf "\033[31m✗ %s\033[0m\n" "$*" >&2; }
ok() { printf "\033[32m✓ %s\033[0m\n" "$*"; }
require_macos() {
@bjarneo
bjarneo / theme-change-workspace.sh
Created December 1, 2025 16:27
Change your theme on hyprland workspace switch
#!/bin/bash
# Map workspaces to omarchy themes
declare -A workspace_themes=(
[1]="catppuccin"
[2]="catppuccin-latte"
[3]="ethereal"
[4]="everforest"
[5]="flexoki-light"
[6]="gruvbox"
@salmin89
salmin89 / background.ts
Last active June 12, 2025 09:37
Chrome Messaging using Native Observables
declare const Observable: any;
// Utility to create an Observable from Chrome's messaging system
function createMessageObservable() {
return new Observable((subscriber: any) => {
// Set up the message listener
const listener = (message: any, sender: chrome.runtime.MessageSender, sendResponse: (response?: any) => void) => {
// Forward the message to the Observable
subscriber.next({ message, sender, sendResponse });
return true;
@stevebauman
stevebauman / example.diff
Last active April 2, 2025 07:43
Sort JS Imports by length using ESLint Rule (asc)
-import axios from 'axios';
-import fs from 'fs';
-import path from 'path';
-import a from 'a';
-import somethingElse from '../somethingElse';
+import a from 'a';
+import fs from 'fs';
+import path from 'path';
+import axios from 'axios';
+import somethingElse from '../somethingElse';
@stenuto
stenuto / timelapse.sh
Created June 18, 2024 20:56
Timelapse script
#!/bin/bash
# Check if interval argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 -int <interval_in_seconds>"
exit 1
fi
# Extract the interval value
interval=$2
@jdevalk
jdevalk / copyrightholder.php
Last active January 6, 2022 04:00
This is how to add the copyrightHolder schema to the Website Schema piece Yoast SEO outputs.
<?php
add_filter( 'wpseo_schema_website', 'example_change_website_schema', 10, 2 );
/**
* Changes the Yoast SEO Website schema.
*
* @param array $data The Schema Website data.
* @param Meta_Tags_Context $context Context value object.
*
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active August 7, 2026 09:17
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@fzldn
fzldn / beautifier.js
Last active March 17, 2025 02:29
VS Code Laravel Blade formatter using extension Beautify 1.5.0 by HookyQR with js-beautify hacks
...
Beautifier.prototype.beautify = function() {
...
var source_text = this._source_text;
// BEGIN
source_text = source_text.replace(/\{\{(--)?((?:(?!(--)?\}\}).)+)(--)?\}\}/g, function(m, ds, c, dh, de) {