Skip to content

Instantly share code, notes, and snippets.

View Medalink's full-sized avatar

Eric Percifield Medalink

View GitHub Profile
fields @timestamp, @message
| filter @message not like "START RequestId"
| filter @message not like "END RequestId"
| filter @message not like "REPORT RequestId"
| filter @message not like "Caching Laravel configuration"
| filter @message not like "Loaded Composer autoload"
| filter @message not like "Executing warming requests..."
| filter @message not like "Creating storage directory"
| filter @message not like "No scheduled commands are ready to run"
| filter @message not like "NOTICE: ready to handle connections"
@Medalink
Medalink / .hyper.js
Last active August 19, 2023 20:11
Hyper Terminal Settings for Windows 11 using Powershell 7.x
shell: 'C:\\Program Files\\PowerShell\\7\\pwsh.exe',
shellArgs: ['-noexit', '-command', 'Set-Location D:\\Develop'],
@Medalink
Medalink / brightoak.yml
Created March 26, 2020 19:34 — forked from rorymcdaniel/brightoak.yml
Starter Github workflow file for Laravel projects
name: CI
on:
push:
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
name: Tests
@Medalink
Medalink / command.sh
Last active October 20, 2021 18:38
Cleanup local git branch
git branch --merged | egrep -v "(^\*|main|qa|develop)" | xargs git branch -d
Vue.swal({
title: 'Are you sure?',
text: 'Selecting another sub category will result in all selections being reset.',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'Yes, clear selections',
reverseButtons: true,
}).then((result) => {
if (result.value) {
// Button was accepted, do your thing
@Medalink
Medalink / StringHelpers.php
Created March 14, 2019 19:06
Determine if the first letter of a string is uppercase and is A-Z
<?php
/**
* Determine if the first letter of a string is uppercase and is A-Z
*
* Note: we use ctype here as it uses the current locale to help with multi-language/emoji decoding.
*
* @param string $string
* @return bool
*/
@Medalink
Medalink / ClientController.php
Created May 25, 2018 17:07
Code Challenge: What improvements could you make to this controller method to reduce code duplication? Are there any additional laravel functions/method that could replace raw/manual PHP code?
<?php
namespace App\Http\Controllers;
use App\Actblue;
use App\Client;
use App\Packages\ReportHelper;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
@Medalink
Medalink / BatchProcess.php
Created April 6, 2018 18:55
This job connects to a Google Cloud Datastore and pulls down results into a MySQL DB. The results in the datastore are updated to reflect they have been pulled. Duplicates are also marked as pulled via a version number.
<?php
namespace App\Jobs;
use App\Actblue;
use Bugsnag\BugsnagLaravel\Facades\Bugsnag;
use Google\Cloud\Core\ServiceBuilder;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Database\QueryException;
<?php
echo '<pre>';
//ini_set('pcre.backtrack_limit', '1048');
ini_set('pcre.recursion_limit', '2097');
error_reporting(E_ALL ^ E_STRICT);
try {
$reg = preg_match_all('/[0-9-]+,"([^"]?)+/', '0,"120"1,"Global Ship Request"10,"108697687"30,"X6 HORA "33,"PM"34,"23214"35,"190"36,"16722"37,"6682"60,"50"112,"50"116,"1"119,"0"188,"^XA^CF,0,0,0^PR12^MD30^PW800^PON^CI13^LH0,20
^FO12,139^GB753,2,2^FS
^FO12,405^GB777,2,2^FS
SELECT sum(total_target_count) FROM email_blasts WHERE created_at >= '2017-09-01 00:00:00' AND created_at < '2017-10-01 00:00:00';
SELECT sum(delivered) FROM email_blasts WHERE created_at >= '2017-09-01 00:00:00' AND created_at < '2017-10-01 00:00:00';