Skip to content

Instantly share code, notes, and snippets.

View logeshpaul's full-sized avatar

Logesh Paul logeshpaul

View GitHub Profile
@logeshpaul
logeshpaul / gist:2652267
Created May 10, 2012 10:07
CSS: Base Template
/* -----------------------------------------------
Version: 0.1 [DD MM YY]
SMACSS [Scalable Modular Architecture for CSS]
Reference: http://smacss.com/
CATEGORIES:
1. Master - Default elements style redefinitions
2. Layout - Stacking/Placement of elements
3. Modules - Module wise style definitions
@logeshpaul
logeshpaul / gist:2652274
Created May 10, 2012 10:09
CSS: layout.css
/*-------------------------------------------------
LAYOUT: GENERAL
Major layout defintions should be prefixed with a
letter "l-"
-------------------------------------------------*/
@logeshpaul
logeshpaul / gist:2665324
Created May 12, 2012 08:54
CSS: Border radius
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
@logeshpaul
logeshpaul / gist:2666666
Created May 12, 2012 14:01
CSS: Background gradient
background: #e8e8ea;
background-image: -moz-linear-gradient(top, #f6f6f7, #e8e8ea);
background-image: -webkit-gradient(linear, center top, center bottom, from(#f6f6f7), to(#e8e8ea));
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f7', endColorstr='#e8e8ea');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f7', endColorstr='#e8e8ea')";
background-image: linear-gradient(top, #f6f6f7, #e8e8ea);
@logeshpaul
logeshpaul / vimeoPlayPause.js
Last active October 4, 2015 20:27
JS: Vimeo Play/Pause - API
$f($("#vimeo_player iframe")[currentVideo].id).api("play");
@logeshpaul
logeshpaul / replaceBrokenImages.js
Last active December 11, 2015 15:08
JS: jQuery to replace broken images
$(window).load(function() {
$('img').each(function() {
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
// image was broken, replace with your new image
this.src = 'http://www.tranism.com/weblog/images/broken_ipod.gif';
}
});
});
var f_page = "smashmag"; // the page name for your fan page, e.g. the 'smashmag' part of http://facebook.com/smashmag
var t_page = "smashingmag"; // the account name for your main twitter account
function add_commas(number) {
if (number.length > 3) {
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++) {
if ((mod == 0) && (i == 0)) {
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
@logeshpaul
logeshpaul / FeedEK.css
Created March 12, 2013 04:34
Fetch RSS feeds from any site
.feedEkList{
color: #918d8a;
}
.itemTitle {
width: 300px;
height: 25px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
@logeshpaul
logeshpaul / method-1.js
Last active December 15, 2015 12:29
Run JavaScript Only After Entire Page Has Loaded
$(window).bind("load", function() {
// code here
});
@logeshpaul
logeshpaul / fade-effect.css
Created May 24, 2013 10:25
Fade Effect on Link Hover
/* Hover CSS properties */
a {
color:blue;
/* First we need to help some browsers along for this to work.
Just because a vendor prefix is there, doesn't mean it will
work in a browser made by that vendor either, it's just for
future-proofing purposes I guess. */
-o-transition:.5s;
-ms-transition:.5s;