Skip to content

Instantly share code, notes, and snippets.

Avatar

Bubba bubba-h57

View GitHub Profile
@bubba-h57
bubba-h57 / getcsvmacro.php
Last active December 5, 2022 23:11
Laravel Collection Macro for Reading a CSV file into a Collection
View getcsvmacro.php
<?php
Collection::macro('getcsv', static function (string $file): Collection {
$resource = fopen($file, 'rb');
$result = new Collection();
$header = fgetcsv($resource);
while (($line = fgetcsv($resource)) !== false) {
$result->add($line);
}
fclose($resource);
@bubba-h57
bubba-h57 / .wslconfig
Created July 19, 2022 14:14
WSLg Configurations for Laravel PHP Development with PHPStorm and Tinkerwell
View .wslconfig
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# Specify a custom Linux kernel to use with your installed distros.
# The default kernel used can be found at https://github.com/microsoft/WSL2-Linux-Kernel
# kernel=
# Limits VM memory to use no more than 16 GB, this can be set as whole numbers using GB or MB
memory=16GB
@bubba-h57
bubba-h57 / instructions.md
Last active January 16, 2023 18:05
Configuring Jetbrains Gateway and WSL
View instructions.md

Step 1: SSH Daemon

In your WSL instance, re-install OpenSSH server as follows.

sudo apt remove --purge openssh-server
sudo apt install openssh-server

Edit /etc/ssh/sshd_config (e.g. sudo vi /etc/ssh/sshd_config) and add the following lines to the bottom of the file. Ensure you replace WSL_ACCOUNT_NAME with your WSL2 account name.

@bubba-h57
bubba-h57 / Dockerfile
Created February 7, 2022 16:49
Modifications to the 8.0 Sail Dockerfile for more functionality as a .devcontainer.
View Dockerfile
FROM ubuntu:21.04
LABEL maintainer="Taylor Otwell"
ARG WWWGROUP
ARG NODE_VERSION=16
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive
@bubba-h57
bubba-h57 / .php-cs-fixer.php
Created October 21, 2021 15:10
My Code Sniffer
View .php-cs-fixer.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
/* PHP arrays should be declared using the configured syntax. */
'array_syntax' => ['syntax' => 'short'],
/* Binary operators should be surrounded by space as configured. */
@bubba-h57
bubba-h57 / phpunit.yml
Created April 29, 2020 19:37
Github Actions Continuous Integration/Testing workflow for PHP 7.4, Laravel 7, MariaDb, & Redis.
View phpunit.yml
name: Laravel 7, MariaDb, & Redis CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
continuous-integration:
View keybase.md

Keybase proof

I hereby claim:

  • I am bubba-h57 on github.
  • I am bubba (https://keybase.io/bubba) on keybase.
  • I have a public key ASCdPhM2q9ZHXatdGCzMpylJOredaPtgOItaZ6oKFkT7tQo

To claim this, I am signing this object:

@bubba-h57
bubba-h57 / start.stop.function.js
Last active September 26, 2019 16:00
So, you want a Google App Script function that will allow you to insert the current date time stamp, but then that date time stamp should not ever change again?
View start.stop.function.js
/**
* This is your `=START()` function.
* It will make a call to the `handleTimestamp_(propertyName)`
* Which does the real work.
*/
function START(){
SpreadsheetApp.getActiveRange().getA1Notation()
return handleTimestamp_('starttimestamep'.concat(SpreadsheetApp.getActiveRange().getA1Notation()))
}
@bubba-h57
bubba-h57 / parallel_stub.php
Created September 10, 2019 15:29
Stub File for PHP extension parallel
View parallel_stub.php
<?php declare(strict_types=1);
/**
* A helper file for providing autocomplete information for your IDE.
*
* This file should not be included in your code, only analyzed by your IDE!
*
* @author Bubba Hines <bubba@stechstudio.com>
*/
@bubba-h57
bubba-h57 / phpbuild.sh
Created February 7, 2019 15:27
Build Similar PHP 7.2 & 7.3 Debug/Pthreaded Builds on the same system using phpbrew
View phpbuild.sh
#!/usr/bin/env bash
brew install openssl
brew install gd
brew install imagemagick
brew install libmemcached
brew services start memcached
phpbrew install --name 7.3-debug php-7.3 \
+zts \
+debug \