Skip to content

Instantly share code, notes, and snippets.

View Luciaisacomputer's full-sized avatar
💭
In yer source code checking yer accessibilities

Lucia Adams Luciaisacomputer

💭
In yer source code checking yer accessibilities
View GitHub Profile
@Luciaisacomputer
Luciaisacomputer / WP Config Version Control Setup
Last active August 29, 2015 14:19
WordPress version control for wp-config. Create a local config file, and then a dev config file on each server and you are set!
if ( file_exists( dirname( __FILE__ ) . '/wp-local-config.php' ) ) {
include( dirname( __FILE__ ) . '/wp-local-config.php' );
define( 'WP_LOCAL_DEV', true ); //You can use this to further enable/disable things
}else if( file_exists( dirname( __FILE__ ) . '/wp-dev-config.php' ) ){
include( dirname( __FILE__ ) . '/wp-dev-config.php' );
define( 'WP_REMOTE_DEV', true ); //You can use this to further enable/disable things
}else{
define('DB_NAME', 'db_name');
/** MySQL database username */
@Luciaisacomputer
Luciaisacomputer / Foundation Mobile Dropdown
Created April 15, 2015 13:41
Mobile dropdown menu for Foundation. Add to topbar.php and remove lines 42-53 in header.php
<div class="top-bar-container contain-to-grid show-for-small-up">
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>
</li>
<li class="toggle-topbar menu-icon"><a href=""><span>Menu</span></a></li>
</ul>
<section class="top-bar-section">
<?php foundationPress_top_bar_l(); ?>
@Luciaisacomputer
Luciaisacomputer / Page Title Change on Blur
Created April 29, 2015 03:44
Change the pages title when not focused
function(){
var a=document.title;
window.onblur=function(){
document.title="Something Funny"
},
window.onfocus=function(){
document.title=a
}
}
@Luciaisacomputer
Luciaisacomputer / add-to-functions.php
Created June 29, 2015 16:21
Customize Tiny MCE (Paragraph Indent)
//Custom Text Formatting Options
function wpb_mce_buttons_2($buttons) {
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('mce_buttons_2', 'wpb_mce_buttons_2');
/*
* Callback function to filter the MCE settings
@Luciaisacomputer
Luciaisacomputer / .gitignore
Created August 19, 2015 13:57
Typical Git Ignore for WordPress/FoundationPress
.DS_Store
node_modules/
*.sass-cache*
bower_components/
stylesheets/*.css
*.log
wp-local-config.php
wp-content/uploads
@Luciaisacomputer
Luciaisacomputer / Foundation Grunt with BrowserSync, SlickJS
Last active October 4, 2015 17:20
A grunt setup for using Browser Sync and Slick JS with FoundationPress. Will Add to this as I need more things.
module.exports = function(grunt) {
// time
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
// If you can't get source maps to work, run the following command in your terminal:
<?php
//***MEGA REMOVAL OF BACKEND THINGS**********************************************
//There is apparently no easy way to remove the fields, so you have to
//unset some, filter others, and inline hide one or two
//sorry in advance for this mess of spaghetti code
//********************************************************************************
//Remove Admin Color Scheme Options from WordPress dashboard
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
@Luciaisacomputer
Luciaisacomputer / phone-number-regex.txt
Created February 26, 2016 17:54
Regex for *most* phone numbers
\+(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|
2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|
4[987654310]|3[9643210]|2[70]|7|1)
\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*\d\W*(\d{1,2})$

Array
(
    [0] => Array
        (
            [event_name] => Anotha Event
            [event_times] => Array
                (
                    [0] => Array
<IfModule mod_rewrite.c>
  RewriteEngine on

  # Attempt to load files from production if
  # they're not in our local version
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule wp-content/uploads/(.*) \
 http://{PROD}/wp-content/uploads/$1 [NC,L]