Skip to content

Instantly share code, notes, and snippets.

View logeshpaul's full-sized avatar

Logesh Paul logeshpaul

View GitHub Profile
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@mathewbyrne
mathewbyrne / slugify.js
Created October 12, 2011 04:34
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@dieseltravis
dieseltravis / gist:811331
Last active September 24, 2015 21:27
Unicode character html code
javascript:!function(n,t,e,o){e=t.prompt("char?",n.getSelection()),o=function(n,t,e){return t=n.charCodeAt(0),t>=55296&&56319>=t&&n.length>1&&(e=n.charCodeAt(1),e>=56320&&57343>=e)?1024*(t-55296)+e-56320+65536:t}(e),t.alert("HTML: &#"+o+"; \nURL: "+n.encodeURIComponent(e)+" \nUnicode: U+"+o.toString(16).toUpperCase())}(window,top)
@dmolsen
dmolsen / Facebook + Twitter Fan Count
Created September 27, 2010 15:47
Pulls the Facebook fan count and Twitter follower count for the specified accounts.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var f_page = "wvumountaineers"; // the page name for your fan page, e.g. the 'wvumountaineers' part of http://facebook.com/wvumountaineers
var t_page = "westvirginiau"; // the account name for your main twitter account
function add_commas(number) {
if (number.length > 3) {
var mod = number.length % 3;