Skip to content

Instantly share code, notes, and snippets.

View jonhassall's full-sized avatar

Jonathan Hassall jonhassall

View GitHub Profile
@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:
*