Skip to content

Instantly share code, notes, and snippets.

View theskumar's full-sized avatar

Saurabh Kumar theskumar

View GitHub Profile
@theskumar
theskumar / gist:1021465
Created June 12, 2011 11:37 — forked from derek/gist:1017507
Beautified Google Doodle for 06/09/11 - Les Paul
(function() {
var g = null,
h;
try {
if (!google.doodle) google.doodle = {};
var j,
m,
o,
p,
r,
@theskumar
theskumar / resume.html
Created February 21, 2012 17:02
html: resume Template (Basic)
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="container">
@theskumar
theskumar / sample.php
Created March 2, 2012 14:25
Docblock Comment standards
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Short description for file
*
* Long description for file (if any)...
*
* PHP version 5
@theskumar
theskumar / gist:1998923
Created March 8, 2012 05:32
javacript - async load
(function(d, t) {
var g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = '//third-party.com/resource.js';
s.parentNode.insertBefore(g, s);
}(document, 'script'));
@theskumar
theskumar / paragraph-width-fix.css
Created March 27, 2012 06:32
css: paragraph min width with fluid elements
p:before {
content: "";
width: 10em;
display: block;
overflow: hidden;
/* For Demonstration */
border: 1px solid green;
}
@theskumar
theskumar / .gitignore
Created April 22, 2012 05:38
csharp .gitignore file
[Oo]bj
[Bb]in
*.user
*.suo
*.[Cc]ache
*.bak
*.ncb
*.log
*.DS_Store
[Tt]humbs.db
@theskumar
theskumar / list_countries.txt
Created April 22, 2012 17:07
Complete list of countries in world
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua & Deps
Argentina
Armenia
Australia
Austria
@theskumar
theskumar / Preferences.sublime-settings
Created July 2, 2012 10:35
sublime: user settings
{
"font_size": 12,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"draw_white_space": "all"
}
@theskumar
theskumar / ga: page scroll
Created August 2, 2012 16:54
Google analytics script for tracking page scroll
// Google Analystics Script: Track page scroll
// All you need is to add where _gaq defined:
// https://github.com/h5bp/html5-boilerplate/wiki/ga-augments
$(function(){
var isDuplicateScrollEvent,
scrollTimeStart = new Date,
$window = $(window),
$document = $(document),
scrollPercent;
@theskumar
theskumar / gist:3423710
Created August 22, 2012 08:16
js: sort_by function
// reusable sort functions, and sort by any field
// UsagesSort by price high to low
// homes.sort(sort_by('price', true, parseInt));
// Sort by city, case-insensitive, A-Z
// homes.sort(sort_by('city', false, function(a){return a.toUpperCase()}));
var sort_by = function(field, reverse, primer){
var key = function (x) {return primer ? primer(x[field]) : x[field];};
return function (a,b) {
var A = key(a), B = key(b);