Skip to content

Instantly share code, notes, and snippets.

View stevebauman's full-sized avatar
💎
Sparklin’

Steve Bauman stevebauman

💎
Sparklin’
View GitHub Profile
@stevebauman
stevebauman / StateableInterface
Last active August 29, 2015 14:16
A stateable interface to be implemented on the inventory transactions model
interface StateableInterface
{
//E-Commerce states
const STATE_COMMERCE_CHECKOUT = 'commerce-checkout';
const STATE_COMMERCE_SOLD = 'commerce-sold';
const STATE_COMMERCE_RETURNED = 'commerce-returned';
const STATE_COMMERCE_RETURNED_PARTIAL = 'commerce-returned-partial';
const STATE_COMMERCE_RESERVERD = 'commerce-reserved';
const STATE_COMMERCE_BACK_ORDERED = 'commerce-back-ordered';
@stevebauman
stevebauman / inventory_transaction_tables
Last active August 29, 2015 14:16
Transaction Tables
Schema::create('inventory_transactions', function (Blueprint $table)
{
$table->increments('id');
$table->timestamps();
$table->integer('stock_id')->unsigned();
$table->string('state');
$table->decimal('quantity', 8, 2)->default(0);
$table->foreign('stock_id')->references('id')->on('inventory_stocks')
->onUpdate('restrict')
/**
* Escapes the inserted value for LDAP.
*
* @param string $value The value to escape
* @param string $ignore The characters to ignore
* @param int $flags The PHP flag to use
*
* @return bool|string
*/
public function escapeManual($value, $ignore = '*', $flags = 0)
@stevebauman
stevebauman / gist:00aaeaa0c7ca260a0aa5
Last active August 29, 2015 14:21
Recursive BOM Array Method
/**
* Returns all of the assemblies items in an
* easy to work with array.
*
* @param bool $recursive
*
* @return array
*/
public function getAssemblyItemsList($recursive = true, $depth = 0)
{
@stevebauman
stevebauman / gist:1a8100e155cd6e380d54
Last active August 29, 2015 14:21
Recursive BOM Method Results
array(2) {
[0]=>
array(7) {
["id"]=>
string(1) "2"
["name"]=>
string(9) "Table Top"
["metric_id"]=>
string(1) "1"
["category_id"]=>
@stevebauman
stevebauman / Purify Example
Created May 23, 2015 18:56
Purify Example
// Your BaseController
use Stevebauman\Purfiy\Purify;
class BaseController extends Controller
{
protected $purfiy;
public function __construct(Purify $purfiy)
{
@stevebauman
stevebauman / backup.bat
Created July 5, 2017 21:30
MySQL Windows Server Backup Script
echo Starting Backup.
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set dt=%%c-%%a-%%b)
For /f "tokens=1-4 delims=:." %%a in ('echo %time%') do (set tm=%%a%%b%%c%%d)
set database=database
set username=root
set password=password
set file=%database%-%dt%-%tm%.sql
@stevebauman
stevebauman / TextareaUpload.vue
Created July 11, 2017 16:08
Markdown Text Area Upload VueJS 2 Component
<template>
<textarea
:id="id"
:name="name"
:value="value"
:placeholder="placeholder"
:rows="rows"
:cols="cols"
class="form-control"
@dragover.prevent
@stevebauman
stevebauman / Editor.vue
Last active April 2, 2019 07:00
VueJS 2 + Trix Editor V-Model Component
<template>
<div></div>
</template>
<script>
import Trix from 'trix';
export default {
props: ['value'],
@stevebauman
stevebauman / export-reports.ps1
Created November 20, 2017 22:24
A Powershell Script to Export SQL Report Server 2012 Reports (SRSS)
# Configuration data
# SQL Server Instance name.
[string] $server = "PC-RPT01";
# ReportServer Database.
[string] $database = "ReportServer";
# Path to export the reports to.
[string] $folder = "C:\Users\johndoe\Desktop\Reports";