Skip to content

Instantly share code, notes, and snippets.

View kevyworks's full-sized avatar

Kevyworks kevyworks

View GitHub Profile
@kevyworks
kevyworks / gist:be09706b3ee96d8c91074a4f3f1295d2
Created January 3, 2023 16:00 — forked from fj/gist:1597544
Slightly nicer way of writing large files to disk with PHP
// Copy big file from somewhere else
$src_filepath = 'http://example.com/all_the_things.txt'; $src = fopen($src_filepath, 'r');
$tmp_filepath = '...'; $tmp = fopen($tmp_filepath, 'w');
$buffer_size = 1024;
while (!feof($src)) {
$buffer = fread($src, $buffer_size); // Read big file/data source/etc. in small chunks
fwrite($tmp, $buffer); // Write in small chunks
}
@kevyworks
kevyworks / mailhog-install.sh
Created September 19, 2022 02:49 — forked from Caffe1neAdd1ct/mailhog-install.sh
Installation of MailHog on CentOS 7
## Install packages
sudo yum install wget curl vim epel-release
sudo yum install daemonize.x86_64
## Install mailhog
wget https://github.com/mailhog/MailHog/releases/download/v0.2.0/MailHog_linux_amd64
sudo chmod +x MailHog_linux_amd64
sudo chown root:root MailHog_linux_amd64
sudo mv MailHog_linux_amd64 /usr/sbin/mailhog
@kevyworks
kevyworks / prep-ncv-env.sh
Last active April 14, 2022 15:54
Prepare Dev Machine for: Node Composer & Laravel Valet
# MOJAVE: https://gist.github.com/kevmt/476716bfb0383d3fda699e4fcacc6470
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Terminal Aliases
echo "alias artisan='php $PWD/artisan'" >> ~/.bash_profile
echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile
echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
@kevyworks
kevyworks / wsl2_nginx.md
Last active June 22, 2021 12:32
WSL2 Nginx, PHP, MySQL - Different PHP versions

Different PHP Version

Installation:

$ sudo apt-get update -y
$ sudo apt-get install nginx mariadb-server -y
$ sudo service nginx start
@kevyworks
kevyworks / package.conf
Created August 10, 2020 11:30
Laragon Package Config
# PHP
php=https://github.com/leokhoa/laragon-packages/releases/download/4.0.9/php-7.3.2-Win32-VC15-x64.zip
# Apache
apache=https://home.apache.org/~steffenal/VC14/binaries/httpd-2.4.41-win64-VC14.zip
# phpMyAdmin
*phpmyadmin=https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-english.zip
# MariaDB
@kevyworks
kevyworks / SendNotificationEmail.php
Created June 23, 2020 20:31 — forked from faneder/SendNotificationEmail.php
Email notification in laravel
<?php
namespace Eder\Jobs;
use Eder\Jobs\Job;
use Illuminate\Contracts\Mail\Mailer;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
@kevyworks
kevyworks / SendNotificationEmail.php
Created June 23, 2020 20:31 — forked from faneder/SendNotificationEmail.php
Email notification in laravel
<?php
namespace Eder\Jobs;
use Eder\Jobs\Job;
use Illuminate\Contracts\Mail\Mailer;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Bus\SelfHandling;
use Illuminate\Contracts\Queue\ShouldQueue;
@kevyworks
kevyworks / Local Dev Environment.md
Last active May 2, 2020 18:23
macOS Mojave (Dev)

Install Guide

macOS Mojave 10.14 - kevyworks

Preparing Environment

1. Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@kevyworks
kevyworks / valet-wsl.md
Last active February 28, 2020 20:53
Valet-WSL

Get Started

Follow the Wiki from valet-wsl

Switching PHP versions

Some projects may require older php version but minimum is 7.2 for the CLI which valet-wsl requires. The default Ubuntu 18.04 LTS is pre installed with Php version 7.4 in valet it is easy to use a specific version of php by