Skip to content

Instantly share code, notes, and snippets.

@erainey
erainey / send_button_metrics.php
Created September 29, 2012 18:54
PHP: Facebook Send Button Metrics via Graph API
<?php
/***
Facebook Send Button Metrics via Graph API
Originally posted on Facebook Developer Blog by Zhen Fang.
Source: http://developers.facebook.com/blog/post/501
***/
$app_id = "YOUR_APP_ID";
@erainey
erainey / jquery.fb-social-plugins.js
Created September 29, 2012 18:52
JavaScript: Facebook Social Plugins jQuerified
(function($) {
$.fn.xfbmlParse = function() {
FB.XFBML.parse(document.getElementById(this));
return this
};
$.fn.fbActivityFeed = function(options) {
var activityFeedSettings = {site:window.location, width:"300", height:"300", header:true, colorscheme:"light", font:"arial", border_color:"", recommendations:false, filter:" ", ref:" "};
return this.each(function() {
if(options) {
$.extend(activityFeedSettings, options)
@erainey
erainey / recursive_directory.php
Created September 29, 2012 18:19
PHP: Recursive Directory Listing
/***
This function will read the full structure of a directory. It's recursive becuase it doesn't stop with the one directory, it just keeps going through all of the directories in the folder you specify.
http://www.codingforums.com/showthread.php?t=71882
***/
function getDirectory( $path = '.', $level = 0 ){
$ignore = array( 'cgi-bin', '.', '..' );
// Directories to ignore when listing output. Many hosts
@erainey
erainey / jquery.equalizeCols.js
Created September 29, 2012 18:06
JavaScript: jQuery Equalize Columns
(function($){
/********EQUALIZE************/
$.fn.equalizeCols = function(){
var height = 0,
reset = $.browser.msie ? "1%" : "auto";
return this
.css("height", reset)
.each(function() {