Skip to content

Instantly share code, notes, and snippets.

View mikeerickson's full-sized avatar

Mike Erickson mikeerickson

View GitHub Profile
@andrewdelprete
andrewdelprete / webpack.config.js
Last active April 12, 2023 01:55
Webpack: Tailwind CSS + PurgeCSS Example
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require("path");
const glob = require("glob-all");
const PurgecssPlugin = require("purgecss-webpack-plugin");
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
* https://github.com/FullHuman/purgecss-webpack-plugin
*/
<?php
/**
* Automatically alias Laravel Model's to their base classname.
* Ex: "App\Models\User" now can just be accessed by "User"
*/
if (! function_exists('aliasModels')) {
function aliasModels() {
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->name('*.php')->in(base_path().'/app');
@Ellrion
Ellrion / .tinker
Last active February 28, 2019 23:12
Laravel tinker helper include file
<?php
/*
|--------------------------------------------------------------------------
| Tinker configs and helpers
|--------------------------------------------------------------------------
|
| Possible run with this include `php artisan tinker .tinker`
| Or see http://psysh.org/#configure (~/.config/psysh/config.php)
| `'defaultIncludes' => [ getcwd() . '/.tinker', ]`
@mikeerickson
mikeerickson / laravel-setup.sh
Last active December 30, 2015 12:28
Laravel Setup Script to craft new Laravel 4.1 (has drop down support for Laravel 4.0.x as well) application and optionally install a suite of commonly used developer tools. In addition, provides support for creating a new MySQL database as well as setting up a new git repository.
#!/bin/bash
# Current Version 0.0.9
# dont forget to create write permissions on this file
# 2013-12-20: 0.0.9
# - refactored .bowerrc to store in 'lib' instead of components
# 2013-12-16: 0.0.8
# - Updated Gruntfile.js and .jshint gist referece
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@JeffreyWay
JeffreyWay / tip.sh
Created August 15, 2013 17:51
Ever want to undo everything that you've worked on since the last commit (including adding new files)? Here's a little alias to help with that.
alias gundo='git reset HEAD~ && git clean -df'
@fideloper
fideloper / index.html
Created June 4, 2013 18:21
Quick example of Google prettify
<!-- your site content -->
<script src="mother-fuckin-jquery.js" type="text/javascript"></script>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript"></script>
<script type="text/javascript">
$(function()
{
$('.post pre, table code').addClass('prettyprint');
prettyPrint();
});
@JeffreyWay
JeffreyWay / laravel.js
Last active April 6, 2024 20:12
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}