Skip to content

Instantly share code, notes, and snippets.

@anthonyterrell
anthonyterrell / FlickrComponent.php
Created March 24, 2013 23:13
Flickr set component for CakePHP
<?php
/**
* Flickr Component
*
* This file will share logic to your controller
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
@anthonyterrell
anthonyterrell / NoCount.css
Created April 5, 2013 16:21
These styles remove the section which displays a count or who else "liked." This is not my code but am unable to find it's original source. I've been using it for some time now and it's pretty bullet proof. Facebook Like Button: https://developers.facebook.com/docs/reference/plugins/like/
.fb-like {
width: 50px;
height: 30px;
overflow: hidden;
}
div.likewrap span.fb_edge_comment_widget{
display: none !important;
}
@anthonyterrell
anthonyterrell / datatableSort.php
Last active February 18, 2016 16:29
jQuery datatable server side column sorting. This is done in PHP, more specifically Laravel 5.2.*
if($request->get('order')[0]['column']){
$data->orderBy($request->get('columns')[$request->get('order')[0]['column']]['data'], $request->get('order')[0]['dir']);
}
@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
@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
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_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;
}
@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 / 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 / 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();
}