Skip to content

Instantly share code, notes, and snippets.

@dhh
dhh / linux-setup.sh
Last active September 23, 2025 13:15
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active October 19, 2025 03:29
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',
@wdmtech
wdmtech / trim-strings-in-laravel-model-on-save.md
Last active August 18, 2023 14:55
Trim all strings in a Laravel Model before they are saved
public static function boot() {
    parent::boot();

    // Trim all string attributes before they are saved
    static::saving(function($model){
        $attributes = collect($model->getAttributes())->map(function ($attribute) {
            if (is_string($attribute)) {
                return trim($attribute);
 }
@jbergler
jbergler / .gitignore
Last active April 9, 2024 19:49
Acestream on Mac
.vagrant
@Gaubee
Gaubee / rAF.js
Last active December 25, 2015 14:29 — forked from paulirish/rAF.js
// MIT license
(function() {
"use strict"
var G = window,
lastTime = 0,
vendors = ['ms', 'moz', 'webkit', 'o'],
_KEY_AnimationFrame = 'AnimationFrame',
_KEY_equest = 'equest',
_KEY_ancel = 'ancel',
_KEY_requestAnimationFrame = 'r' + _KEY_equest + _KEY_AnimationFrame,