Skip to content

Instantly share code, notes, and snippets.

View barbwiredmedia's full-sized avatar

Barbara Talbot barbwiredmedia

View GitHub Profile
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@dejanmarkovic
dejanmarkovic / NOBLOGREDIRECT explained and fix
Created January 8, 2014 20:15
NOBLOGREDIRECT explained and fix
A little explanation for those who have no idea what NOBLOGREDIRECT is.
The define(‘NOBLOGREDIRECT’, ‘%siteurl%’); inside of the wp-config.php makes it so that when someone enters a subdomain that does not exist on your site to redirect to whatever url you wish it to. You can use this to have it either go to a specific FAQ page or directly back to the main root installation, anywhere you want to direct it. the %siteurl% can be replaced for example define(‘NOBLOGREDIRECT’, ‘http://frumph.net/FAQ/site-create’);
When someone in their browser tries to go to (for example) http://badsubdomain.frumph.net/ a subomain which doesn’t exist, it will go to what is defined in NOBLOGREDIRECT.
Without using NOBLOGREDIRECT the (for example) http://badsubdomain.frumph.net/ – which is a subdomain that doesn’t exist would direct to the signup page asking which reports whether or not the user can create the bad subdomain in question. This is fine, there’s nothing wrong with it redirecting to the signup page if someone put
@landru247
landru247 / WordPress: WP Dashboard Meta box.php
Last active December 27, 2015 10:29
WordPress: WP Dashboard Meta box - adds a function that creates a "default" created by LevyOnline Meta box to WP Dashboard
// CUSTOM DASHBOARD WIDGET
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Trademark Creative Ltd.', 'custom_dashboard_help');
}
php_value memory_limit 64M
@landru247
landru247 / CSS: Transition.css
Created October 18, 2013 13:40
CSS: Transition - multiple examples of transition usage. View Demo: http://learn.shayhowe.com/advanced-html-css/transitions-animations
Transition Demo
---------------------------------------
.box {
background: #8ec63f;
transition-property: background;
transition-duration: 1s;
transition-timing-function: linear;
}
.box:hover {
background: #f7941d;
<div id="meowmeow" role="img" aria-label="Kitty Cats"></div>
<style>
#meowmeow {
background: url(http://placekitten.com/720/405/) no-repeat center center;
background-size: cover;
height: 0;
padding-bottom: 56.25%; /* 16:9 */
}
</style>
@landru247
landru247 / CSS: list-style-image
Created September 13, 2013 18:47
CSS: list-style-image - a better way to add and align bullet images in lists
.list_links ul {
list-style:none;
}
.list_links li {
background:url(bullet.png) no-repeat left center;
padding-left: (n)px; /* the width of your image + some space */
margin: 3px 0;
}
@landru247
landru247 / WordPress: Contact Form 7 - validation.
Created September 9, 2013 19:46
WordPress: Contact Form 7 - extend validation for things like phone numbers, zip codes, etc....
// Link to project page
// http://code-tricks.com/contact-form-7-custom-validation-in-wordpress/
//Available Names for text field with this file
date1 – Compare date1 (date2 should be bigger than date1)
date2 – Compare date2 (date2 should be bigger than date1)
url – validate URL
emailAddress – validate email address
@landru247
landru247 / State List
Created August 23, 2013 19:01
HTML: Select - state list
<select name="State">
<option value="" selected="selected">Select a State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
@landru247
landru247 / Boilerplate: Terms & Conditions
Created July 30, 2013 18:00
Boilerplate: Terms & Conditions - replace place-holder
<p><strong>1. Terms</strong></p>
<p>By accessing this web site, you are agreeing to be bound by these web site Terms and Conditions of Use, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this web site are protected by applicable copyright and trade mark law.</p>
<p><strong>2. Use License</strong></p>
<p>Permission is granted to temporarily download one copy of the materials (information or software) on place-holder web site for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:modify or copy the materials;use the materials for any commercial purpose, or for any public display (commercial or non-commercial);</p>
<p>attempt to decompile or reverse engineer any software contained on place-holder web site; remove any copyright o