Skip to content

Instantly share code, notes, and snippets.

View mojowill's full-sized avatar
:octocat:

Will Wilson mojowill

:octocat:
View GitHub Profile
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active April 9, 2024 14:08
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@tillkruss
tillkruss / default-mp6-color-scheme.php
Last active August 23, 2021 20:17
Change the default MP6 admin color scheme.
<?php
add_filter( 'get_user_option_admin_color', function( $color_scheme ) {
global $_wp_admin_css_colors;
if ( ! isset( $_wp_admin_css_colors[ $color_scheme ] ) ) {
$color_scheme = 'ectoplasm';
}
@davidyell
davidyell / exampleFinds.php
Last active February 25, 2016 10:06
Find's in CakePHP
<?php
/*
These are some example files for CakePHP 2.x
Using containable
The problem with this is that if Group doens't match, then it will just return a blank array
dimension, because containable is just going to join the arrays in php
*/
@jakimowicz
jakimowicz / redmine gitlab sync
Created November 15, 2012 16:22
simple (and dirty) sync between redmine issues and gitlab issues
#!/usr/bin/env ruby
require 'faraday'
require 'json'
require 'gitlab'
module Redmine
Host = nil
APIKey = nil
@BronsonQuick
BronsonQuick / gist:3774261
Created September 24, 2012 05:05
Changes wp_link_pages to be an unordered list in WordPress
<?php /*
* Function similar to wp_link_pages but outputs an ordered list instead and adds a class of current to the current page
*/
function pico_link_pages( $args = '' ) {
$defaults = array(
'before' => '<p>' . __( 'Pages:' ), 'after' => '</p>',
'link_before' => '', 'link_after' => '',
'next_or_number' => 'number', 'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ), 'pagelink' => '%',
@mikejolley
mikejolley / gist:2974310
Created June 22, 2012 18:13
WooCommerce - Set default state/country for checkout
/**
* Manipulate default state and countries
*
* As always, code goes in your theme functions.php file
*/
add_filter( 'default_checkout_country', 'change_default_checkout_country' );
add_filter( 'default_checkout_state', 'change_default_checkout_state' );
function change_default_checkout_country() {
return 'XX'; // country code
@mikejolley
mikejolley / gist:1800395
Created February 11, 2012 15:01
WooCommerce - Change order notes placeholder
add_filter('woocommerce_checkout_fields', 'custom_woocommerce_checkout_fields');
function custom_woocommerce_checkout_fields( $fields ) {
$fields['order']['order_comments']['placeholder'] = 'Your custom placeholder';
return $fields;
}
@josegonzalez
josegonzalez / readme.md
Last active November 17, 2018 16:16
Example Readme for CakePHP plugins that use MIT license

[PLUGIN NAME] Plugin

[ONE LINE DESCRIPTION OF PROJECT]

Background

[A PARAGRAPH DESCRIBING WHY YOU BUILT THIS]

[ANOTHER PARAGRAPH DESCRIBING YOUR IMPETUS FOR RELEASING THIS]