Skip to content

Instantly share code, notes, and snippets.

View logeshpaul's full-sized avatar

Logesh Paul logeshpaul

View GitHub Profile
@logeshpaul
logeshpaul / outdated-browser.html
Created March 11, 2019 05:38
Outdated browser indication
<!--[if lt IE 10]>
<div
style="background: #212121; padding: 10px 0; box-shadow: 3px 3px 5px 0 rgba(0,0,0,.3); clear: both; text-align:center; position: relative; z-index:1;"
>
<a href="http://windows.microsoft.com/en-US/internet-explorer/"
><img
src="images/ie8-panel/warning_bar_0000_us.jpg"
border="0"
height="42"
width="820"
@logeshpaul
logeshpaul / absolute-fluid-container.css
Created November 15, 2017 06:19
Horizontally center aligned fluid absolute container
.flash-notify {
top: 0;
left: 50%;
width: auto;
transform: translateX(-50%);
position: absolute;
padding: 10px;
}
@logeshpaul
logeshpaul / pdf-options.md
Created June 15, 2016 18:58
Hide PDF toolbar, Controls, Etc

URL

http://DOMAIN/FILE_NAME.pdf#toolbar=0

Embed

``

@logeshpaul
logeshpaul / launch_sublime_from_terminal.markdown
Last active August 29, 2015 14:16
Launch sublime text from your terminal

Launch Sublime Text from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/3

Installation

@logeshpaul
logeshpaul / Multiple_Github_Accounts.markdown
Last active August 29, 2015 14:16
Managing multiple Github accounts

Step 1 - Create a New SSH Key

ssh-keygen -t rsa -C "your-email-address"

Step 2 - Name your SSH Key

When prompted, save the file as id_rsa_COMPANY.

Step 3 - Attach the New Key

@logeshpaul
logeshpaul / SimpleWebApp.markdown
Last active August 29, 2015 14:04
Gulp + Sass + Browser Sync

Prerequisites

Before starting, you should have:

A project containing at least an index.html & some scss files. NodeJS installed. GulpJS installed globally 'npm install -g gulp'

Step 1 - Install We need to install 3 tools locally to our project - gulp, gulp-sass & browser-sync. In your terminal/command line, navigate to your project directory and run

@logeshpaul
logeshpaul / uri.js
Created August 3, 2014 17:31
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@logeshpaul
logeshpaul / oneClick.js
Created July 1, 2014 09:13
Have something happen on a click event, but only once! Unbind the click handler after the element has been clicked once.
$('#my-selector').bind('click', function() {
$(this).unbind('click');
alert('Clicked and unbound!');
});
@logeshpaul
logeshpaul / jsSelector.js
Created May 21, 2014 06:10
Select attributes based on specific data
$("form input[name^='username']").val();
@logeshpaul
logeshpaul / outside.click.js
Created May 7, 2014 10:51
Detect if clicked/touched outside some block
// 'touchstart' helps trigger the event in touch devices
$(document).on('click touchstart', function(e){
if ($(e.target).closest("#menuscontainer").length == 0) {
// .closest can help you determine if the element
// or one of its ancestors is #menuscontainer
console.log("hide");
}
});
$('#menuscontainer').on('click', function(e){