Skip to content

Instantly share code, notes, and snippets.

View Artistan's full-sized avatar

Charles Peterson Artistan

View GitHub Profile
@Artistan
Artistan / Shapeoko Settings Reference.md
Last active January 6, 2019 05:22
Shapeoko Settings Reference.
@Artistan
Artistan / Appendable.md
Created November 5, 2018 16:21
Make a model dynamically appendable.
@Artistan
Artistan / LoadData.php
Last active February 23, 2021 04:16
Load Data Local Infile - Laravel Seeder
<?php
/**
* notes
*
* decent tutorial on load data...
* https://tenerant.com/blog/using-load-data-local-infile-in-a-laravel-migration/
*
* simple example
* https://gist.github.com/Xeoncross/2012182
*
@Artistan
Artistan / gw-calc-subtotal.php
Created October 19, 2018 15:45 — forked from spivurno/gw-calc-subtotal.php
Gravity Wiz // Gravity Forms // Calculation Subtotal Merge Tag
<?php
/**
* --- STOP! ---
* Get the latest version:
* https://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/
* -------------
*
* Calculation Subtotal Merge Tag
*
* Adds a {subtotal} merge tag which calculates the subtotal of the form. This merge tag can only be used
@Artistan
Artistan / routes-api.php
Created September 4, 2018 14:22
Laravel API routes
<?php
use Illuminate\Http\Request;
// api auth routes...
Route::group(['middleware' => ['auth:api']], function () {
// unversioned api routes
Route::get('/user', function (Request $request) {
return $request->user();
});
@Artistan
Artistan / Extend.php
Created August 22, 2018 15:31
Laravel 5.6 Password does/not contain login name
<?php
namespace App;
use Illuminate\Support\Facades\Input;
use Illuminate\Validation\Validator;
/**
* Class Extend
*/
class Extend
@Artistan
Artistan / Application.php
Created August 13, 2018 20:05
override laravel application class
<?php
namespace Artistan\ZeroNullDates\Tests;
use Illuminate\Foundation\Application as IllApplication;
class Application extends IllApplication
{
/**
* The custom configuration path defined by the developer.
@Artistan
Artistan / a ngrok_background.sh
Last active February 23, 2024 22:02 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@Artistan
Artistan / Upsert.php
Created August 6, 2018 13:02
Upsert Eloquent Model
<?php
namespace My\Database;
trait Upsert {
/**
* @requires @param string $primaryKey
* OR
* @requires @param array $unique_keys
*