Skip to content

Instantly share code, notes, and snippets.

View davidsivocha's full-sized avatar

David Sivocha davidsivocha

View GitHub Profile
@ljufa
ljufa / ssdtrim.md
Last active November 21, 2026 17:20
Fix Severe SSD Write Speed Degradation on Pop!_OS / Linux (LUKS + LVM)

Fix Severe SSD Write Speed Degradation on Pop!_OS / Linux (LUKS + LVM)

The Symptom

Your Linux desktop (especially Pop!_OS or Ubuntu) randomly freezes under heavy write loads. Browsers lock up when downloading files, IDEs (like IntelliJ or VS Code) stutter during indexing, and compiling code brings the system to a halt.

Before You Start: Benchmark Your Drive

Before applying this fix, test your raw SSD write speed. We will write a 5GB file using direct I/O to bypass your RAM cache and measure the actual silicon speed.

Run this command in your terminal:

@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',
@ShirtlessKirk
ShirtlessKirk / luhn.js
Last active December 31, 2025 09:18
Luhn validation algorithm
/**
* Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers
* @author ShirtlessKirk. Copyright (c) 2012.
* @license WTFPL (http://www.wtfpl.net/txt/copying)
*/
var luhnChk = (function (arr) {
return function (ccNum) {
var
len = ccNum.length,
bit = 1,
@mikeschinkel
mikeschinkel / TCB_JSON_API.php
Created November 2, 2011 16:44
Creates JSON class for Tom C. Barret to load tickets via a RESTful API
<?php
/**
* Creates JSON class for Tom C. Barrett to load tickets via a RESTful API:
*
* @example:
*
* URL: http://example.com/api/ticket/12345
*
* @see:
*