Skip to content

Instantly share code, notes, and snippets.

View smokeyfro's full-sized avatar

Chris Rault smokeyfro

View GitHub Profile
@Viper007Bond
Viper007Bond / whatissoslow.php
Last active March 19, 2025 10:22
WordPress: Times how long it takes each filter and action to run and displays results at the end of the page. Quick and dirty.
<?php
/**
* This little class records how long it takes each WordPress action or filter
* to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
*
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
*
@ajmorris
ajmorris / install_wp.sh
Last active December 14, 2015 22:08
Installs WordPress from Git, creates folder structure, database, domain, and vhost. It finishes with opening up the install page of WP. This was heavily influenced by http://logos-creative.com/roll-a-new-mamp-wordpress-install-quickly-with-this-shell-script/. I needed more though. :)
#!/bin/sh
cd /Users/ajmorris/Dropbox/Websites
printf "What would you like to name your new WordPress root directory (i.e. mywpdir)?"
read NEWDIR
git clone https://github.com/WordPress/WordPress.git $NEWDIR
cd $NEWDIR
printf "What version of WordPress would you like to use? It must be a non-beta release (i.e. 3.5.1)."
read WPVER
git checkout $WPVER
rm -rf .git
@jcroft
jcroft / layout.sass
Created March 1, 2012 04:51
How easy responsive design can be with Sass
#content-wrapper
+container
#about
// Default (smallest screens)
+column(100%)
background-color: #ccc
// Respond to other screen widths
@ajmorris
ajmorris / fire-style.css
Created January 26, 2012 00:21
Sample style.css for a Fire child theme for Headway Base
/*
Theme Name: Headway Fire Child Theme
Theme URI: http://headwaythemes.com
Description: A fiery take on a powerful element. This child theme features gradients and rounded corners in all the right places. It also contains separate widget styles, text shadows and a subtle black background.
Version: 0.1
Author: Headway Themes
Author URI: http://headwaythemes.com
Template: headway
*/
@ziadoz
ziadoz / awesome-php.md
Last active May 8, 2025 07:37
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@ajmorris
ajmorris / functions.php
Created December 21, 2011 21:28
Headway Child Theme functions.php file for adding a fluid header and footer
<?php
add_action('headway_html_open', 'aj_add_header');
function aj_add_header() {
echo '<div class="aj-header">Hello from the header!</div>';
}
add_action('headway_whitewrap_close', 'aj_add_footer');
@dcneiner
dcneiner / jquery.dontAnnoyDevsInWebkit.js
Created December 20, 2011 17:20
Removes the use of layerX and layerY in jQuery 1.4, 1.5, 1.6 (If you can't upgrade to jQuery 1.7 for some reason) - Even referencing these properties throws a warning in Chrome
// Add this code snippet after including jQuery
// The if statement protects you in case you forget to remove this
// once you upgrade to 1.7, or if you try to use it with jQuery 1.3
if (jQuery.event.props[17] === "layerX" ) {
jQuery.event.props.splice(17,2);
}
// `Clearfix
//--------------------------------------------------
// Can be added to other style rules via:
//
// #foobar
// @extend .clearfix
.clearfix
zoom: 1
// `Clearfix
//--------------------------------------------------
// Can be added to other style rules via:
//
// #foobar
// @extend .clearfix
.clearfix:before,
.clearfix:after
@chriseppstein
chriseppstein / 0_selector_hacks.scss
Created September 14, 2011 04:27
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}