Skip to content

Instantly share code, notes, and snippets.

Bubba bubba-h57

View GitHub Profile
@bubba-h57
bubba-h57 / phpunit.yml
Created Apr 29, 2020
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 Sep 26, 2019
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 Sep 10, 2019
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 Feb 7, 2019
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 \
@bubba-h57
bubba-h57 / LockerRoom.py
Created May 1, 2018
Simple Distributed Advisory Locking Class for AWS Lambda
View LockerRoom.py
import os
import redis
import logging
import string
import random
from collections import namedtuple
from redis.exceptions import RedisError
Lock = namedtuple("Lock", ("valid", "resource", "key", "ttl"))
@bubba-h57
bubba-h57 / test.php
Created Sep 26, 2017
Have a function timeout on itself
View test.php
<?php
try {
test();
} catch (TimeoutException $e) {
$e->handle();
} catch (Throwable $t) {
printf('Some other error occured. %s', $t->getMessage());
}
@bubba-h57
bubba-h57 / luthers_insults.js
Created Aug 25, 2017
Generate Random Citations of Martin Luther Insults
View luthers_insults.js
var insults = [
{
"work": "Heidelberg Disputation from Vol. 31 of Luther's Works.",
"quotes": [
{
"page": "51",
"quote": "Your sin smells to high heaven."
}
]
},
@bubba-h57
bubba-h57 / NonBreakableSnakeCase.php
Last active Jul 5, 2017
Convert studly, traditional snake, and kebob case strings into a non-breakable snake case string.
View NonBreakableSnakeCase.php
<?php
function non breakable snake case($value, $delimiter = ' ')
{
$value = ucwords(str_replace(['-', '_'], ' ', $value));
if (! ctype_lower($value)) {
$value = preg_replace('/\s+/u', '', $value);
$value = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value), 'UTF-8');
}
@bubba-h57
bubba-h57 / .php_cs
Created Jun 21, 2017
My favorite Code Style Rules for php-cs-fixer
View .php_cs
<?php
$rules = [
'@PSR2' => true,
// Additional Non-PSR2 rules
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['align_double_arrow' => true],
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
You can’t perform that action at this time.