Skip to content

Instantly share code, notes, and snippets.

View niladam's full-sized avatar

Madalin Tache niladam

View GitHub Profile
@niladam
niladam / ccsettings.md
Created January 31, 2026 16:23 — forked from ivanfioravanti/ccsettings.md
Claude Code with various models

Using Claude Code with various AI providers

Create various settings file I have one file for each provider, all in ~/.claude

  • KIMI K2.5: kimi_settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.moonshot.ai/anthropic",
@niladam
niladam / SKILL.md
Created January 30, 2026 23:11 — forked from jsadoski-rockhall/SKILL.md
Logging Best Practices Skill
name description
Logging Best Practices
Use before implementing logs in a medium to large scale production system.

This skill is adpated from "Logging sucks. And here's how to make it better. by Boris Tane.

When helping with logging, observability, or debugging strategies, follow these principles:

Core Philosophy

@niladam
niladam / gist:50f325365b939de282e87a6a4426977f
Created January 28, 2026 08:18 — forked from driesvints/gist:70162727698210274c3982ad87b37ed5
Cloudflare PDF generation in Laravel.
// Controller method...
public function download()
{
return response()->streamDownload(function () use ($invoice) {
$token = config('services.cloudflare.api_token');
$accountId = config('services.cloudflare.account_id');
$cloudflareApi = 'https://api.cloudflare.com/client/v4';
echo Http::withToken($token)
->post($cloudflareApi.'/accounts/'.$accountId.'/browser-rendering/pdf', [
<?php
namespace App\Listeners;
use Exception;
use Throwable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Process;
@niladam
niladam / hls.sh
Created November 9, 2024 16:46 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@niladam
niladam / firewall.sh
Created October 30, 2024 17:25 — forked from andrasbacsai/firewall.sh
Update a Hetzner Firewall rule with your IP address
#!/bin/bash
# Script to update a firewall rule in a Hetzner Firewall with your current IP address.
# Good if you would like to restrict SSH access only for your current IP address (secure).
#################
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you
# added all the required rules.
# I use a separate firewall rule just for SSH access.
#################
@niladam
niladam / getPosts.php
Created September 27, 2024 18:34 — forked from chrispian/getPosts.php
Import WordPress posts, categories, and tags to a Laravel table
<?php
/*
* NOTES:
*
* - This was designed for my personal use and could be more robust.
* - Make sure to update the tables you want to import into.
* - Make sure to update the website url you want to import from.
* - Customize as needed. I had very few posts and no media.
*
*/
# SETUP #
DOMAIN=example.com
PROJECT_REPO="[email protected]:example.com/app.git"
AMOUNT_KEEP_RELEASES=5
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S)
RELEASES_DIRECTORY=~/$DOMAIN/releases
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME
# stop script on error signal (-e) and undefined variables (-u)
@niladam
niladam / BaseResource.php
Created May 15, 2024 20:19 — forked from nathandaly/BaseResource.php
Tenancy for Laravel & Filament V3 (Tenant per database)
<?php
/**
* Below is an the extended Filament resource your tenant panel resources
* will have to extend so that the queries are scoped properly.
*/
namespace App\Filament;
use Filament\Resources\Resource;
<?php
namespace App\Helper;
trait WpTrait
{
/**
* Replaces double line-breaks with paragraph elements.