Skip to content

Instantly share code, notes, and snippets.

@trevorgreenleaf
trevorgreenleaf / Laravel Query Debug
Created July 10, 2015 04:03
Laravel Query Debug
DB::connection()->enableQueryLog();
$query = DB::getQueryLog();
$lastQuery = end($query);
dd($lastQuery);
chown -R apache:apache filename
@trevorgreenleaf
trevorgreenleaf / scripts.js
Last active September 1, 2015 02:32
jQuery: Start Project
(function($) {
// Lets Begin :)
})(jQuery);
@trevorgreenleaf
trevorgreenleaf / Laravel Packages
Created October 20, 2015 23:11
A bunch of packages I use on projects
Comments:
https://github.com/RoumenDamianoff/laravel-disqus
Scape:
https://github.com/guzzle/guzzle
https://github.com/symfony/dom-crawler
https://github.com/symfony/css-selector
Newsletters:
point domain name servers to digital ocean
create domain in digital ocean
add site in forge
enter domain name and for the folder make it the project name
next add your github repo and select the branch
See who logged in last:
lastlog
View all of the log files on the server:
ls -l /var/log
@trevorgreenleaf
trevorgreenleaf / remove_dashboard_widgets
Last active December 17, 2015 15:09
remove_dashboard_widgets - Remove the dashboard widgets for all users
// remove_dashboard_widgets - Remove the dashboard widgets for all users
//===================================================================================================
function remove_dashboard_widgets()
{
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
@trevorgreenleaf
trevorgreenleaf / remove_menu_items
Created May 22, 2013 17:55
Modify the admin menus for all users
/remove_menu_items - Modify the menus for all users
//==================================================================
function remove_menu_items()
{
global $menu;
$restricted = array(
__('Links'),
//__('Posts'),
//__('Comments'),
//__('Media'),
#!/bin/bash
# Installation script for a Wordpress 3.0 website on Ubuntu 10.04
#
# Josh Kersey
# Created: May 15, 2012
# Last Update: June 13, 2012
# get setup parameters
echo "apache vhost name (one word):"
<?php
/**
Plugin Name: User Switching in Admin Bar
Plugin URI: http://markwilkinson.me
Description: Build upon the User Switching plugin (http://wordpress.org/extend/plugins/user-switching/) by John Blackbourn and adds a dropdown list of users in the WordPress admin bar with a link to switch to that user.
Author: Mark Wilkinson
Author URI: http://markwilkinson.me
Version: 1.0
*/