Skip to content

Instantly share code, notes, and snippets.

View emjayess's full-sized avatar
💭
🪞 mirroring repos from gitlab

Matthew J. Sorenson emjayess

💭
🪞 mirroring repos from gitlab
View GitHub Profile
@emjayess
emjayess / drush-mac
Created April 18, 2024 19:06
temporary drush command file to use a specific brew-managed php installation on macos
#!/opt/homebrew/Cellar/[email protected]/8.1.27/bin/php
<?php
require __DIR__ . '/drush.php';
if (App::environment(['local', 'staging'])) {
Route::get('phpinfo', phpinfo());
}
<?php
/**
* shorthand laravel php syntax tips via)
* Laravel Business: https://www.youtube.com/post/UgzGftWbzdljAptGJOR4AaABCQ
* via Caleb Porzio: https://laravel-livewire.com/screencasts/s7-simple-table
*/
// instead of if/else
if ( $status == 'processing' ) {
return 'blue';
<?php
// short syntax available in php 7.4 and up
Project::with('user')
// regular anonymous php function expression
->whereHas('user', function($query) {
$query->where('role', 'admin');
})
<?php
/**
* What is this: 'thisInterval()' as a closure-as-callable-php-variable
*
* Explainer: imagine having a job scheduler with a production accuracy requirement to the minute..
* Now imagine desiring an easy way to loosen that accuracy constraint, for sake of easier tests..
* With an approach like this, just put the accuracy setting into configuration, e.g. .env file.
*/
// this $cfg could come from a per-environment .env file, for example
@emjayess
emjayess / git_branching_model_considered.md
Last active February 17, 2021 16:09
A Git branching model considered...

Feature development - proposed branching model (graph)

Take a feature: like 'OBH'

__ master ______________________________________.___________________
  \                                            / (pull request ^)
   \__ develop ____________________________.__/_____________________
      \                                   / (pull request ^)
       \__ develop/obh/master _[._._._.]_/                          
@emjayess
emjayess / getinsights.zsh
Last active October 26, 2024 16:52
'getinsights' shortcut for @nunomaduro's phpinsights
# added to ohmyzsh custom aliases; for laravel / artisan
getinsights() {
composer require nunomaduro/phpinsights --dev
php artisan vendor:publish --provider="NunoMaduro\PhpInsights\Application\Adapters\Laravel\InsightsServiceProvider"
php artisan insights
}
@emjayess
emjayess / keybase.md
Created April 5, 2018 23:08
keybase claimant

Keybase proof

I hereby claim:

  • I am emjayess on github.
  • I am mattso (https://keybase.io/mattso) on keybase.
  • I have a public key ASAbqQc40ZibE2hPbrsmrGPfIiIxd1EfQL2zIHSr80PsEgo

To claim this, I am signing this object:

@emjayess
emjayess / 1.Enter-pyspark-shell
Last active August 29, 2015 14:14
Apache Spark & 'mcmath' NormTermOrder 10k
macarooni:geekout emjayess$ pyspark
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Spark assembly has been built with Hive, including Datanucleus jars on classpath
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
15/02/03 09:18:31 INFO SecurityManager: Changing view acls to: emjayess
15/02/03 09:18:31 INFO SecurityManager: Changing modify acls to: emjayess
15/02/03 09:18:31 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(emjayess); users with modify permissions: Set(emjayess)
15/02/03 09:18:32 INFO Slf4jLogger: Slf4jLogger started
@emjayess
emjayess / davinci-cover-letter.md
Created November 24, 2014 05:54
Leonardo da Vinci's job application/appeal to Ludovico Sforza

The Skills of Leonard da Vinci

via Letters of Note

My Most Illustrious Lord,

Having now sufficiently seen and considered the achievements of all those who count themselves masters and artificers of instruments of war, and having noted that the invention and performance of the said instruments is in no way different from that in common usage, I shall endeavour, while intending no discredit to anyone else, to make myself understood to Your Excellency for the purpose of unfolding to you my secrets, and thereafter offering them at your complete disposal, and when the time is right bringing into effective operation all those things which are in part briefly listed below:

  1. I have plans for very light, strong and easily portable bridges with which to pursue and, on some occasions, flee the enemy, and others, sturdy and indestructible either by fire or in battle, easy and convenient to lift and place in position. Also means of burning and destroy