Skip to content

Instantly share code, notes, and snippets.

View madhur's full-sized avatar
🎯
Focusing

Madhur Ahuja madhur

🎯
Focusing
View GitHub Profile
@@site_url = 'http://www.mysite.com'
task :cloud_basic do
puts 'Generating tag cloud...'
require 'rubygems'
require 'jekyll'
include Jekyll::Filters
options = Jekyll.configuration({})
site = Jekyll::Site.new(options)

This is the code I use for the tag cloud at www.librador.com:

{% for tag in site.tags %}
  {% assign t = tag.first %}
  {% assign posts = tag.last %}
  <a class="tag tag{{ posts | size }}" href="/tags/#tag-{{ t | to_id }}">{{ t }}</a>
{% endfor %}

It expects there to be a CSS class called tag and several ones called tag1, tag2, tag3 etc, where the number is the number of posts with that tag. Here's my version:

@madhur
madhur / SocialMiner.js
Created June 2, 2011 21:33
socialminer
function SocialMiner()
{
var verbose=true;
var profileArray=new Array();
var tabUrl;
this.getTabUrl=function()
@madhur
madhur / miner.js
Created June 2, 2011 23:31
miner
function SocialMiner()
{
var verbose=true;
var profileArray=new Array();
this.tabUrl;
var that=this;
@madhur
madhur / 0001-albino-windows-refactor.patch
Created September 1, 2011 07:34 — forked from jonforums/0001-albino-windows-refactor.patch
Make Jekyll play nice with Windows again post Albino + posix-spawn refactor
diff --git a/lib/albino.rb b/lib/albino.rb
index 387c8e9..b77d55e 100644
--- a/lib/albino.rb
+++ b/lib/albino.rb
@@ -1,4 +1,5 @@
require 'posix-spawn'
+require 'rbconfig'
##
# Wrapper for the Pygments command line tool, pygmentize.
@madhur
madhur / calendar.js
Created December 21, 2011 09:23
Color coded SharePoint 2010 Calendar
_spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad');
var SEPARATOR = "|||";
function WaitForCalendarToLoad()
{
if (SP.UI.ApplicationPages.CalendarNotify.$4a)
{
var OldCalendarNotify =
@madhur
madhur / Archive.html
Created December 30, 2011 07:37
Archive
---
layout: page
title: Archive
permalink: /archive/
---
<div id="archive">
{% for post in site.posts %}
{% capture tmp_year %}{{ post.date|date:'%Y' }}{% endcapture %}
{% if year != tmp_year %}
@madhur
madhur / approval.js
Created January 9, 2012 18:22
SharePoint 2010 Approval workflow with dynamic approvers
<div id='intake'>
<img src="/sites/nishantverma/GBSRequest/SiteAssets/loading.gif" />
<br/>
Submitting your request for approval
</div>
<script type="text/javascript" src="/sites/nishantverma/GBSRequest/SiteAssets/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/sites/nishantverma/GBSRequest/SiteAssets/jquery.SPServices-0.7.0.min.js"></script>
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SPUpdateField
{
class Program
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget