Skip to content

Instantly share code, notes, and snippets.

View dwoodard's full-sized avatar

Dustin Woodard dwoodard

View GitHub Profile
#!/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 March 3, 2019 18:32
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>
@dwoodard
dwoodard / gist:2da017dd7c52824de162
Last active August 29, 2015 14:13
Fresh-Win-Install
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install binroot
choco install gnuwin
choco install cmdaliases
choco install nugetpackageexplorer
@dwoodard
dwoodard / gist:9629577
Created March 18, 2014 21:04
html-5-bolierplate
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon(s) in the root directory -->
@dwoodard
dwoodard / gist:8605138
Last active January 4, 2016 09:58
CSS Layout Floats, Position
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display: block; } body {line-height: 1; } ol, ul {list-style: none; } blockquote, q {quotes: none; } blockquote:before, blockquote:after, q:before, q:after {content: ''; content: none; } table {border-collapse: collapse; border-spacing: 0; }
</s
#!/bin/sh
#
# Copyright (c) 2012 NGMOCO
# Updated by Jesse Sanford <jsanford@ngmoco.com>
#
# Portions taken from debian package by
# Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as