Skip to content

Instantly share code, notes, and snippets.

View ralphmoran's full-sized avatar
🎯
Working on something interesting

Ralph Moran ralphmoran

🎯
Working on something interesting
View GitHub Profile
@ralphmoran
ralphmoran / PolishNotation.php
Created May 16, 2018 09:00
Polish (Prefix) notation example
<?php
include_once('PolishNotationValidator.php');
use PolishNotationValidator as Validator;
/**
* PolishNotation class
*
* Polish notation calculator.
@ralphmoran
ralphmoran / global_editor
Created November 7, 2018 07:15
Setting VS Code up as globar editor
git config --global core.editor "code -n -w"
@ralphmoran
ralphmoran / launch.json
Last active March 19, 2019 00:06
launch.json - VS Code + XDebug + Homestead + Lavarel
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for PHPUnit",
"type": "php",
"request": "launch",
"port": 9000
},
{
@ralphmoran
ralphmoran / Activate SSL with Laravel Homestead.txt
Last active March 21, 2019 19:04
Activate SSL certificates with Laravel Homestead on IOS
Requirements:
1. Safari
2. Laravel Homestead installed
3. Sites fully working
Follow this tutorial:
https://www.eaglepeakweb.com/blog/how-to-enable-ssl-https-tls-laravel-homestead
@ralphmoran
ralphmoran / .bash_profile
Created March 22, 2019 20:13
My dev's bash_profile
# Artisan management
alias pa= "php artisan"
alias par= "php artisan routes"
alias pam= "php artisan migrate"
alias pam:r= "php artisan migrate:refresh"
alias pam:roll= "php artisan migrate:rollback"
alias pam:rs= "php artisan migrate:refresh --seed"
alias db-reset= "php artisan migrate:reset && php artisan migrate --seed"
alias pda= "php artisan dumpautoload"
@ralphmoran
ralphmoran / MethodChainingFacade.php
Last active September 22, 2019 07:01
Method chaining from instantiation or static. #chaining #facade #static
<?php
class MethodChainingFacade {
protected $concat = [];
/**
* Processes method name.
*
* @param string $name
@ralphmoran
ralphmoran / MethodStaticChainingFacade.php
Created September 22, 2019 07:18
Method static chaining - It only executes method chaining if they are call from static scope. #chaining #static
<?php
final class Maker
{
private static $result = null;
private static $data = [];
/**
* Initializes private members.
*
@ralphmoran
ralphmoran / ShowUserClasses.php
Created September 22, 2019 07:24
It shows user classes only - #reflection #user #class
<?php
class First {}
class Second {}
class Third extends Second {}
class Fourth {}
$userClasses = array_filter(
get_declared_classes(),
function($className) {
@ralphmoran
ralphmoran / ShowUserClasses.php
Created September 22, 2019 07:24
It shows user classes only - #reflection #user #class
<?php
class First {}
class Second {}
class Third extends Second {}
class Fourth {}
$userClasses = array_filter(
get_declared_classes(),
function($className) {
@ralphmoran
ralphmoran / ReturnFileExtension.php
Created September 24, 2019 03:10
Returns only the file extension. #extension #file
<?php
$files = [
'blah.gif',
'my.file.gif',
'my.file.jpg',
'this/is/a/path',
'my.file.xlsx',
'this/is/a/path',
'my.file.php',