Skip to content

Instantly share code, notes, and snippets.

View arvgta's full-sized avatar

Arvind Gupta arvgta

View GitHub Profile
@arvgta
arvgta / PR.js
Last active December 13, 2015 19:19
Display a PageRank Bar on your pages that updates itself - also works in an Ajax environment!
(function($){
$.fn.PageRank_Bar=function(style){
$this = $(this);
if(!style) style = 9; //default style
$(function () { //on DOMready
$.ajax({
url: 'http://4nf.org/php/gPR.php?u=' + location,
success: function(pr) {
if(!pr) pr = 0;
@arvgta
arvgta / GA.js
Created January 10, 2013 14:36
New jQuery Plugin: Minimalist Google Analytics Inclusion
(function($){
$.GA=function(c){
$.ajax({
url: (document.location.protocol == "https:" ?
"https://ssl" : "http://www") + '.google-analytics.com/ga.js',
success: function() {
_gat._getTracker(c)._trackPageview();
},
dataType: 'script'
});