Skip to content

Instantly share code, notes, and snippets.

@brendannee
brendannee / file1.txt
Created November 3, 2011 17:41
Redirect root domain of custom short URLs using bit.ly pro in .htaccess file
RewriteEngine on
RewriteRule ^/?$ http://511contracosta.org [L]
RewriteRule ^(.*)$ http://bit.ly/$1 [R=301,NC]
@theY4Kman
theY4Kman / Source.html
Created November 23, 2011 00:21
Trying to create a Facebook Like button after page load
<iframe src="http://widgets.awe.sm/v3/fblike_button?href=&send=true&data-layout=button_count&show_faces=false&font=verdana&awesm_key=c4e2cc2a143cd4741589587221017e476474399de7d50b21d73c78f20eaf45da&awesm_user_id_profile_url=http%3A%2F%2Fwww.styleseat.com%2Fp%2F32&awesm_user_id_username=they4kman%2Bcrapbag%40gmail.com&awesm_user_id_icon_url=http%3A%2F%2Fstatic.styleseat.com%2Fstatic%2Fuploads%2F2011%2F11%2F14%2F84eebd0d-c74_14_200x200.jpg&awesm_user_id=122" id="order-sharing-fb" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:24px;" allowTransparency="true"></iframe>
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/

Variadic argument support in LESS 1.3.0

.mixin (...) {        // matches 0-N arguments
.mixin () {           // matches exactly 0 arguments
.mixin (@a: 1) {      // matches 0-1 arguments
.mixin (@a: 1, ...) { // matches 0-N arguments
.mixin (@a, ...) {    // matches 1-N arguments
@jkudish
jkudish / no-index-single-tribe-events.php
Created March 3, 2012 06:26
noindex single tribe_events
<?php
add_action('wp_head','tribe_dont_index_single_events');
function tribe_dont_index_single_events() {
if ( is_singular() && get_post_type() == TribeEvents::POSTTYPE )
echo '<meta name="robots" content="noindex">';
}
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@chasers
chasers / al-papi-web-insights-json.json
Created May 10, 2012 18:27
AuthorityLabs Web Insights JSON
{
"results": {
"page_data": {
"h2_tags": [
{
"text": "‘Walk the Plank’ Unconference"
}
],
"image_tags": [
{
@roborourke
roborourke / embed-gist.php
Created June 13, 2012 22:17
Adds autoembedding of gist urls in WordPress
<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@anandkumar
anandkumar / GTM on Genesis Framework
Created October 10, 2012 05:33
Google Tag Manager on Genesis
/**
* Add Add Google Tag Manager script on Genesis Framework
*
* @author Anand Kumar
* @link http://www.blogsynthesis.com/add-google-tag-manager-to-wordpress/#genesis-framework
*
*/
add_action('genesis_before', 'google_tag_manager');
function google_tag_manager() { ?>