Skip to content

Instantly share code, notes, and snippets.

@dwoodard
dwoodard / .eslintrc.cjs
Created January 24, 2025 19:17
eslintrc VILT stack
module.exports = {
'root': true,
'env': {
'browser': true,
'node': true,
'es2021': true
},
'extends': [
'eslint:recommended',
'plugin:vue/vue3-essential'
Understanding the Core Patterns of Blueprint
Blueprint allows you to define your Laravel application's components—like models and controllers—in a concise, human-readable YAML syntax. The key is to recognize the consistent patterns in how these definitions are structured.
Let's focus on simplifying models and controllers, as they are foundational to any Laravel application.
## Models
At its simplest, a model in Blueprint is defined by:
- **Model Name**: The singular, capitalized name of the model.
- **Fields**: Key-value pairs where the key is the field name, and the value is the data type (with optional modifiers).
@dwoodard
dwoodard / User
Last active October 3, 2024 21:38
IG-Metrics
<?php
use Carbon\Carbon;
use FacebookAds\Api;
use Illuminate\Support\Facades\Route;
Route::get('debug', function () {
Api::init(env('FB_APP_ID'), env('FB_APP_SECRET'), env('FB_ACCESS_TOKEN'));
$api = Api::instance();
@dwoodard
dwoodard / notes.md
Last active September 23, 2024 20:16
Kudos

[2024-09-23 18:32:50] local.INFO: array ( 0 => '01h3fvreef1xygk976wp9zvms1', 1 => 'The Eye Institute of Utah',', ) [2024-09-23 18:32:53] local.INFO: array ( 0 => 'Overall', 1 => array ( 'index' => 100, 'industry' => 77.0,

#!/bin/bash
production_path='/root/crg'
env=$(if [ pwd = production_path ]; then echo "prod"; else echo "local"; fi)
# check if .env set
if [ ! -f ".env" ]; then
cp .env.example .env
echo '.env Added '
php artisan key:generate
@dwoodard
dwoodard / truncate
Created May 10, 2020 05:25
truncate string
// truncate('this is a test is a bunch of text now do some truncating')
// truncate('this is a test is a bunch of text now do some truncating', 50, '', '')
// truncate('this is a test is a bunch of text now do some truncating', 50, '', '...')
// truncate('this is a test is a bunch of text now do some truncating', 50, ' ', '...')
const truncate = (string, limit = 50, breakChar = ' ', rightPad = '...') => {
if (string.length <= limit) return string;
const breakPoint = string.substr(0, limit).lastIndexOf(breakChar);
if (breakPoint >= 0 && breakPoint < string.length - 1) {
return string.substr(0, breakPoint) + rightPad;
@dwoodard
dwoodard / gist:a643869a6ea24921d9119bb81804b2d9
Last active August 1, 2024 19:17
Laravel Creating MVC with factories and Seeds in the fewest key strokes

Laravel Creating [M]V[C] with factories and Seeds in the fewest key strokes

Having the Schema Ready would be great place to start!

Dog
- id
- name
@dwoodard
dwoodard / bash-cheatsheet.sh
Created May 9, 2018 21:02 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@dwoodard
dwoodard / gulpfile.js
Created July 31, 2016 20:03
GulpFile
{
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>