Skip to content

Instantly share code, notes, and snippets.

View pankajparashar-zz's full-sized avatar

Pankaj Parashar pankajparashar-zz

View GitHub Profile
@pankajparashar-zz
pankajparashar-zz / jquery-url-parser.js
Created July 6, 2013 07:25
Parse <url> with Javascript.
$(function(){
// The URL we want to parse
var url = 'http://tutorialzine.com/2013/07/quick-tip-parse-urls/?key=value#comments';
// The magic: create a new anchor element, and set the URL as its href attribute.
// Notice that I am accessing the DOM element inside the jQuery object with [0]:
var a = $('<a>', { href:url } )[0];
$('#host').val(a.hostname);
@pankajparashar-zz
pankajparashar-zz / browser.txt
Created June 29, 2013 17:07
One line browser notepad
Version 1
---------
data:text/html, <html contenteditable>
Version 2
---------
data:text/html, <html><head><link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'><style type="text/css"> html { font-family: "Open Sans" } * { -webkit-transition: all linear 1s; }</style><script>window.onload=function(){var e=false;var t=0;setInterval(function(){if(!e){t=Math.round(Math.max(0,t-Math.max(t/3,1)))}var n=(255-t*2).toString(16);document.body.style.backgroundColor="#ff"+n+""+n},1e3);var n=null;document.onkeydown=function(){t=Math.min(128,t+2);e=true;clearTimeout(n);n=setTimeout(function(){e=false},1500)}}</script></head><body contenteditable style="font-size:2rem;line-height:1.4;max-width:60rem;margin:0 auto;padding:4rem;">
Version 3
---------
@pankajparashar-zz
pankajparashar-zz / columns.js
Created June 23, 2013 15:11
Typesetting Responsive CSS3 Columns - http://kaikkonendesign.fi/columns/
Modernizr.load([
//first test need for polyfill
{
test: window.matchMedia,
nope: "matchMedia.js"
}
]);
var ColumnsDemo = {
/*
* Dependencies: Apache POI Library from http://poi.apache.org/
*/
package poi_excels;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.logging.Level;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/**
* Just for fun™: Flickr spinner in pure CSS
*/
@keyframes move {
to { left: 50%; }
}
@keyframes cover {
from,49.9% { z-index: 1 }

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sun, 20 May 2012 00:19:12 GMT till Mon, 20 May 2013 00:19:12 GMT.

Only first 1000 GitHub users according to the count of followers are taken. Sorting algo in pseudocode:

githubUsers
  .filter((user) -> user.followers > 176)
 .sortBy('contributions')
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
#!/bin/sh
#
# A word about this shell script:
#
# It must work only on systems with a /bin/bash.
#
# cat readme.md || exit 1
@pankajparashar-zz
pankajparashar-zz / picture.html
Created May 11, 2013 09:18
Bulletproof syntax for <picture> tag.
<picture alt="fancy pants">
<!-- loaded by browsers that support picture and that support one of the sources -->
<source srcset="big.jpg 1x, big-2x.jpg 2x, big-3x.jpg" type="image/jpeg" media="(min-width: 40em)" />
<source srcset="med.jpg 1x, med-2x.jpg 2x, big-3x.jpg" type="image/jpeg" />
<!-- loaded by IE 8+, non-IE browsers that don’t support picture, and browsers that support picture but cannot find an appropriate source -->
<![if gte IE 8]>
<object data="fallback.jpg" type="image/jpeg"></object>
<span class="fake-alt">fancy pants</span>
<![endif]>