Skip to content

Instantly share code, notes, and snippets.

View jonhassall's full-sized avatar

Jonathan Hassall jonhassall

View GitHub Profile
====
config\cache.php:
====
'file-compressed' => [
'driver' => 'file-compressed',
'path' => storage_path('framework/cache/data'),
'file_chmod' => 0774,
],
====
@webdevgen
webdevgen / DigitalOcean Promo Code 2025 | $200 - $400 | 1-Year Valid.md
Last active May 2, 2025 19:29
DigitalOcean Promo Code 2025 / $200 - $400 / 1-Year Valid

DigitalOcean Promo Code 2025 / $200 - $400 / 1-Year Valid

DigitalOcean offers substantial discounts for new users via exclusive promo codes. These codes provide free credits ranging from $10 to $200 to experience DigitalOcean's cloud services.

This guide provides:

  • A list of currently active and latest DigitalOcean promo codes with applicable credit amounts, services, expiry dates and terms.
  • Step-by-step instructions to easily redeem codes as a new user, along with tips to maximize promotional savings.
  • One special offer that will give you free credits that is valid for 1 year.
@jonhassall
jonhassall / SQL sorting - Alpha > Numbers > Symbols.sql
Created March 21, 2024 22:45
SQL sorting - Alpha > Numbers > Symbols
SELECT id, title
FROM table
ORDER BY
CASE
WHEN title regexp '^[a-zA-Z]+' THEN
1
WHEN title regexp '^[0-9]+' THEN
2
WHEN title regexp '^[^\w]+' THEN
3
@jonhassall
jonhassall / harvard-phrases.txt
Last active December 10, 2022 23:20
Harvard Phrases raw, unformatted - From "IEEE Recommended Practice for Speech Quality Measurements." IEEE Transactions on Audio and Electroacoustics, Vol. 17, Issue 3, 225-246, 1969. APPENDIX C 1965 Revised List of Phonetically Balanced Sentences (Harvard Sentences). DOI 10.1109/IEEESTD.1969.7405210 (IEEE standard 297-1969) and 10.1109/TAU.1969.…
The birch canoe slid on the smooth planks
Glue the sheet to the dark blue background
It's easy to tell the depth of a well
These days a chicken leg is a rare dish
Rice is often served in round bowls
The juice of lemons makes fine punch
The box was thrown beside the parked truck
The hogs were fed chopped corn and garbage
Four hours of steady work faced us
A large size in stockings is hard to sell
@jonhassall
jonhassall / FullTextSearch.php
Last active January 26, 2024 13:29
Laravel Fulltext Search Trait with Weighting
<?php
namespace App\Traits;
/**
* Fulltext search trait. Requires column to have a FULLTEXT index
* Customizable weighted relevance per column
*
* Add to model:
*
@sebastiandg7
sebastiandg7 / ei.cfg
Last active May 2, 2025 23:21
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
[EditionID]
Professional
[Channel]
Retail
@simonw
simonw / react-debouncing.md
Created March 16, 2018 22:15
React debouncing pattern for API calls

React debouncing pattern for API calls

Classic debounce function:

const debounce = (fn, delay) => {
      let timer = null;
      return function (...args) {
          const context = this;
          timer && clearTimeout(timer);

timer = setTimeout(() => {

@djaiss
djaiss / progress_bar_migration_laravel.php
Last active February 5, 2025 13:59
Laravel: Use progress bars in migrations
<?php
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class DoSomething extends Migration
{
public function up()
{
$output = new ConsoleOutput();
# this requires that MySQL is accessed through TCP/IP, not the unix socket.
# run tcpdump for 30 seconds capturing traffic on port 3306
timeout 30 tcpdump -s 65535 -x -nn -q -tttt -i any port 3306 > mysql.tcp.txt
# run pt-query-digest on collected file
pt-query-digest --type tcpdump mysql.tcp.txt >pt.out
@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active December 7, 2024 21:46
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;