Skip to content

Instantly share code, notes, and snippets.

View blueridgemountains1's full-sized avatar

J.S. blueridgemountains1

View GitHub Profile
@blueridgemountains1
blueridgemountains1 / all-timezones-string.php
Last active September 13, 2022 03:04
PHP Enum List of All Timezones
<?php
enum Timezones: string
{
case AfricaAbidjan = 'Africa/Abidjan';
case AfricaAccra = 'Africa/Accra';
case AfricaAddisAbaba = 'Africa/Addis_Ababa';
case AfricaAlgiers = 'Africa/Algiers';
case AfricaAsmara = 'Africa/Asmara';
case AfricaBamako = 'Africa/Bamako';
@blueridgemountains1
blueridgemountains1 / get_all_laravel_models.php
Last active September 8, 2022 17:04
Laravel - PHP - Get All Models Classes - (2022)
<?php
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use ReflectionClass;
function getAllModels(): Collection
{
$composer = json_decode(file_get_contents(base_path('composer.json')), true, 512, JSON_THROW_ON_ERROR);
@blueridgemountains1
blueridgemountains1 / docker_none.txt
Created January 13, 2020 21:46
remove unnamed docker images
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
@blueridgemountains1
blueridgemountains1 / composer.bash
Last active October 5, 2018 16:32
Install composer on a linux machine
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/bin --filename=composer
#mv composer.phar /usr/local/bin/composer
rm composer-setup.php
@blueridgemountains1
blueridgemountains1 / laravel.bash
Created August 15, 2018 19:34
Laravel Helpers
// Add model (with all: factory, seed, migration)
php artisan make:model
@blueridgemountains1
blueridgemountains1 / touchormouse.js
Created April 25, 2018 15:44
Check for Touch or mouse
document.documentElement.addEventListener("mouseover", (el) => {
document.documentElement.classList.add("is-mouse");
});
document.documentElement.addEventListener("touchstart", (el) => {
document.documentElement.classList.add("is-touch");
});
@blueridgemountains1
blueridgemountains1 / Contract.md
Last active March 29, 2018 15:10 — forked from tony-caffe/Contract Killer 3.md
The latest version of Bytes Unlimted ‘killer contract’ for web professionals

Between Johnathan Smith

And [customer name].

Summary:

We’ll always do our best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

@blueridgemountains1
blueridgemountains1 / PrintLinkInCSSPrintOnly.css
Created March 18, 2018 17:46
Print the href when a document is printed with css
@media only print {
a[href]:after {
content: " (" attr(href) ")"
}
}
@blueridgemountains1
blueridgemountains1 / SyncMediaQueriesJavaScript.css
Created March 18, 2018 17:42
Sync Media Queries with Javascript
/** Great way to sync media queries with your javascript: https://mobile.twitter.com/selbekk/status/975145895909117952 **/
body::before {
content: ‘small’,
display: none;
}
@media all and (min-width: 1000px) {
body::before {
content: ‘medium’;
}
@blueridgemountains1
blueridgemountains1 / CenterButtonText.css
Created March 18, 2018 16:49
Center Button Text in Boostrap and .btn class
.btn {
display: inline-flex;
align-content: center;
align-items: center;
}