Skip to content

Instantly share code, notes, and snippets.

@anthonyterrell
anthonyterrell / long-url-test.md
Last active January 17, 2020 17:24
Testing Gist

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec vitae enim sollicitudin, placerat arcu vitae, tristique urna. Duis vitae commodo felis. Morbi tincidunt magna at turpis porttitor maximus. Vivamus fermentum rutrum enim vitae ultrices. Pellentesque ac enim at sem aliquet convallis sit amet quis diam. Etiam sodales urna eget varius pretium. Vivamus id eros vehicula mauris auctor dictum sed rhoncus arcu. Pellentesque tincidunt magna lorem, et pretium mi rhoncus in. Mauris erat erat, elementum a congue ut, imperdiet quis turpis.

https://www.amazon.com/Razor-15120040-Pocket-Rocket-Blue/dp/B001PH9J1I/ref=sr_1_1?keywords=razor+pocket+rocket&qid=1565972694&s=gateway&sr=8-1

@anthonyterrell
anthonyterrell / changelog.sh
Created February 19, 2018 19:36
Generate git changelog
#!/usr/bin/env bash
previous_tag=0
for current_tag in $(git tag --sort=-creatordate)
do
if [ "$previous_tag" != 0 ];then
tag_date=$(git log -1 --pretty=format:'%ad' --date=short ${previous_tag})
printf "## ${previous_tag} (${tag_date})\n\n"
git log ${current_tag}...${previous_tag} --pretty=format:'* %s [View](https://bitbucket.org/projects/test/repos/my-project/commits/%H)' --reverse | grep -v Merge
printf "\n\n"
@anthonyterrell
anthonyterrell / RevisedBlogPostController.php
Last active February 13, 2018 16:36
Improved Blog post controller, after using model observer.
/**
* Store a newly created resource in storage.
*
* @param \App\Http\Requests\BlogPostRequest $request
* @return \Illuminate\Http\Response
*/
public function store(BlogPostRequest $request)
{
try {
@anthonyterrell
anthonyterrell / BlogPostObserver.php
Last active February 13, 2018 18:22
Blog post observer for piece
/**
* BlogPost creating event
*
* @param \App\BlogPost $blogPost
*/
public function creating(BlogPost $blogPost)
{
$blogPost->generateSlug();
}
@anthonyterrell
anthonyterrell / BlogPostController.php
Last active February 13, 2018 18:21
Blog post controller for Laravel Model Observer piece.
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
$post = new BlogPost($request->all());
$post->generateSlug(); // generate a url friendly slug of the article
@anthonyterrell
anthonyterrell / gist:335403f2258637f76e0962ac505d5d3c
Created December 30, 2017 23:01
Using bootstrap 4.0 beta with Laravel 5.4+
# Bootstrap Theming
# http://getbootstrap.com/docs/4.0/getting-started/theming/
# FILE: resources/assets/js/bootstrap.js
try {
window.$ = window.jQuery = require('../../../node_modules/jquery/dist/jquery');
window.Popper = require('../../../node_modules/popper.js/dist/popper');
require('../../../node_modules/bootstrap/dist/js/bootstrap');
@anthonyterrell
anthonyterrell / laravel_wordpress_nginx.txt
Last active April 11, 2017 01:18
NGINX configuration for Wordpress installation in Laravel public directory
# my subdirectory was /blog
# change 'blog' to reference your project sub directory
location /blog {
try_files $uri $uri/ /blog/index.php?$query_string;
}
osascript -e 'quit app “Slack”'
osascript -e 'quit app “Transmit"'
osascript -e 'quit app “Sublime Text”'
osascript -e 'quit app “Sequel Pro”'
osascript -e 'quit app “Terminal”'
vagrant halt all
@anthonyterrell
anthonyterrell / clockout.sh
Created December 2, 2016 17:20
Clockout, relies on :
osascript -e 'quit app “Slack”'
osascript -e 'quit app “Transmit"'
osascript -e 'quit app “Sublime Text”'
osascript -e 'quit app “Sequel Pro”'
osascript -e 'quit app “Terminal”'
vagrant halt all
@anthonyterrell
anthonyterrell / Laravel gitignore
Created May 25, 2016 01:40
Basic .gitignore for laravel installs with homestead configuration
# directories
/vendor
/node_modules
/public/storage
.vagrant/
# project specific files
Homestead.yaml
Homestead.json
.env