Skip to content

Instantly share code, notes, and snippets.

View andyleach's full-sized avatar

Andrew Leach andyleach

  • Wastequip (StackLogix)
  • Charlotte, NC
View GitHub Profile
@tkawa
tkawa / _outline_buttons.scss
Created November 1, 2016 01:47
Bootstrap Outline Buttons
// Backports from Bootstrap 4
@mixin button-outline-variant($color, $color-hover: #fff) {
color: $color;
background-image: none;
background-color: white; // transparent is better?
border-color: $color;
&:hover {
color: $color-hover;
background-color: $color;
@dillinghamio
dillinghamio / SparkRoleMiddleware.md
Last active April 8, 2022 03:50
Team Role Middleware For Laravel Spark

Team Role Middleware For Laravel Spark

Makes it simple to use Spark's role feature on routes

Route::group(['middleware'=>'role:owner'], function(){
    // owners only
});

Route::group(['middleware'=>'role:member'], function(){
@mackhankins
mackhankins / laravel-chartjs.md
Created April 12, 2016 21:40
laravel-chartjs

None of this is production code, but me trying to figure out how to work multiple datasets into a Laravel project with chartjs. Here's my table schema

        Schema::create('statistics', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->string('type');
            $table->string('table');
            $table->integer('count');
            $table->timestamps();
        });
@vwasteels
vwasteels / getMenuHierarchically.md
Last active June 28, 2022 13:12
Retrieve menu items hierarchically in Wordpress
/**
 * Get Menu Items From Location
 *
 * @param $location : location slug given as key in register_nav_menus
 */

function getMenuItemsFromLocation($location) {
	$theme_locations = get_nav_menu_locations();
@JeffreyWay
JeffreyWay / countries.php
Created July 23, 2015 17:01
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@boonebgorges
boonebgorges / bbg-csv-export.php
Created May 13, 2014 18:13
WordPress script for doing a .csv export of misc data
<?php
function bbg_csv_export() {
if ( ! is_super_admin() ) {
return;
}
if ( ! isset( $_GET['bbg_export'] ) ) {
return;
}
@emaildano
emaildano / acf-yoast-add-on.php
Created January 31, 2014 02:51
Add ACFs to Yoast SEO page analysis.
function add_custom_content_to_analysis( $content ) {
global $post;
$custom = get_post_custom( $post->ID );
$custom_content = '';
foreach( $custom as $field )
{
$custom_content .= $field[0].' ';
}
return $content . ' ' . $custom_content;
}
@retgef
retgef / pug-bomb.php
Created June 24, 2012 07:46
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{