Skip to content

Instantly share code, notes, and snippets.

View angelcosta's full-sized avatar
🌐
Working from home

Angel Costa angelcosta

🌐
Working from home
View GitHub Profile
@carstingaxion
carstingaxion / gist:3070690
Created July 8, 2012 12:21
Countdown Shortcode for WordPress
<?php
function countdown_shortcode ( $atts ) {
extract( shortcode_atts( array(
'date' => '',
), $atts ) );
if ( !isset($date) )
return false;
return '<span class="countdown">'.floor( ( strtotime( $date ) - time() )/60/60/24 ).'</span>';
@01-Scripts
01-Scripts / fa-icon-external-link.css
Created June 28, 2012 10:24 — forked from chsh/fa-icon-external-link.css
Show icon after external link using Font Awesome
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@chsh
chsh / fa-icon-external-link.css
Created April 9, 2012 05:32
Show icon after external link using Font Awesome
@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/