Skip to content

Instantly share code, notes, and snippets.

View Dari4sho's full-sized avatar

Dariyousch Käther Dari4sho

  • Jameda GmbH / Docplanner Group
  • Munich
View GitHub Profile
import Stripe from 'stripe' // ^19.1.0
/**
* Example function to upload image and update stripe account logo.
* Call this function.
*/
const doTheThing = async () => {
// Get buffer from real file - this is just an example
const buffer = Buffer.from([])
@Dari4sho
Dari4sho / hypr_swap_workspaces.sh
Created August 31, 2025 03:46
A script for hyprland that takes `left` or `right` and swaps workspaces
#!/usr/bin/env bash
set -euo pipefail
dir="${1:-right}" # "right" or "left"
step=1
[[ "$dir" == "left" ]] && step=-1
cur=$(hyprctl -j activeworkspace | jq -r '.id')
tgt=$((cur + step))
((tgt < 1)) && exit 0
@Dari4sho
Dari4sho / mysql_grant_access_keep_alive.sh
Created August 7, 2025 22:18
Keep alive hetzner firewall whitelist
#!/bin/bash
# Function to get current public IP address with fallbacks
get_public_ip() {
# Try to get the public IP from multiple services
for service in ifconfig.me icanhazip.com api.ipify.org ipinfo.io/ip; do
PUBLIC_IP=$(curl -s --max-time 10 "$service")
if [ -n "$PUBLIC_IP" ]; then
echo "$PUBLIC_IP"
return
@Dari4sho
Dari4sho / amber.css
Created April 18, 2025 21:02
Shadcn additional accent colors (as of 04/25)
.amber {
:root & {
--radius: 0rem;
--background: oklch(1 0 0);
--foreground: oklch(0.141 0.005 285.823);
--card: oklch(1 0 0);
--card-foreground: oklch(0.141 0.005 285.823);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.141 0.005 285.823);
--primary: oklch(0.751 0.183 78.034);
@Dari4sho
Dari4sho / @codesandbox+sandpack-react+2.19.9.patch
Created November 11, 2024 19:32
Patch for `@codesandbox/sandpack-react` using patch-package to not use `eval()`
diff --git a/node_modules/@codesandbox/sandpack-react/dist/index.js b/node_modules/@codesandbox/sandpack-react/dist/index.js
index a419147..59f82ef 100644
--- a/node_modules/@codesandbox/sandpack-react/dist/index.js
+++ b/node_modules/@codesandbox/sandpack-react/dist/index.js
@@ -5037,8 +5037,20 @@ var MAX_MESSAGE_COUNT = MAX_KEYS * 2;
// Const
var GLOBAL = (function getGlobal() {
// NOTE: see http://www.ecma-international.org/ecma-262/6.0/index.html#sec-performeval step 10
- var savedEval = eval;
- return savedEval("this");
@Dari4sho
Dari4sho / auto-increment-version.sh
Last active May 20, 2023 23:36 — forked from CSTDev/auto-increment-version.sh
Script that will find the last Git Tag and increment it. It will only increment when the latest commit does not already have a tag. By default it increments the patch number, you can tell it to change the major or minor versions by adding #major or #minor to the commit message.
#!/bin/bash
tag_prefix="client-v"
# Get the highest tag number
latest_tag=$(git describe --abbrev=0 --tags)
# Extract the prefix and version using regular expression
if [[ $latest_tag =~ ^(.*$tag_prefix)(.*)$ ]]; then
prefix="${BASH_REMATCH[1]}"
/*
* Customized by Misato Takahashi <misato@takahashi.name>
* - fix if Html document has "<!DOCTYPE>" then parse error.
* - fix if Attribute name includes "-" then parse error
* - fix if Unmatch case start tag and end tag then parse error
* - add function "getElementById"
*
* HTML Parser By John Resig (ejohn.org)
* Original code by Erik Arvidsson, Mozilla Public License
* http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
@Dari4sho
Dari4sho / gist:3ebcc73b36a7cbd739378a094c123759
Created November 19, 2018 09:47
.ddev UTF8 Database Error: "Database update failed Error: Index column size too large. The maximum column size is 767 bytes."
[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
innodb_large_prefix=false
<?php
/*
Made by Kudusch (blog.kudusch.de, kudusch.de, @Kudusch)
---------
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>