Skip to content

Instantly share code, notes, and snippets.

View g-rohit's full-sized avatar
🎯
Focusing

G Rohit g-rohit

🎯
Focusing
View GitHub Profile
@g-rohit
g-rohit / OpenInSameWindow.html
Last active January 8, 2019 18:23
Open a page in same window
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>Open page in same window</title>
</head>
@g-rohit
g-rohit / rendering issues in html email.doc
Created June 24, 2019 18:03
The most common HTML email rendering issues
The most common HTML email rendering issues
Text not rendering at full height
If your text is not rendering at the correct height in a majority of email clients, you have probably not set a line-height on your surrounding td.
• line-height is set to 6px more than my font-size
• gives a nice amount of spacing between the text making it much easier to read and of course rendering your text correctly in all email clients
Content not aligning correctly
• because you haven’t added align=”” to your surrounding td
Yahoo align center
• Yahoo usually makes parts or the whole email align to the left
@g-rohit
g-rohit / html-sign.html
Created June 29, 2019 19:27
Html email signature
<html><head></head><body><table class="sc-jAaTju fNCBho" cellpadding="0" cellspacing="0" style="vertical-align: -webkit-baseline-middle; font-size: medium; font-family: 'Trebuchet MS';">
<tbody>
<tr>
<td>
<table class="sc-jAaTju fNCBho" cellpadding="0" cellspacing="0" style="vertical-align: -webkit-baseline-middle; font-size: medium; font-family: 'Trebuchet MS'; width: 100%;">
<tbody>
<tr>
<td height="30"></td>
</tr>
@g-rohit
g-rohit / regex-pw.txt
Created June 30, 2019 18:38
Reg ex for password
You may use this regex with multiple lookahead assertions (conditions):
^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$
This regex will enforce these rules:
At least one upper case English letter, (?=.*?[A-Z])
At least one lower case English letter, (?=.*?[a-z])
At least one digit, (?=.*?[0-9])
At least one special character, (?=.*?[#?!@$%^&*-])
Minimum eight in length .{8,} (with the anchors)
@g-rohit
g-rohit / random-alphabet-letter.js
Last active July 14, 2019 00:20
Print random alphabet letters / words
var alphabet = "abcdefghijklmnopqrstuvwxyz";
console.log(alphabet[Math.floor(Math.random() * alphabet.length)]);
// Priting random 6 letters word
var alphabet = "abcdefghijklmnopqrstuvwxyz";
var random = "";
for (i = 0;i < 6 ; i ++) {
random = random + alphabet[Math.floor(Math.random() * alphabet.length)];
@g-rohit
g-rohit / Change nav bar color on scroll.html
Created July 24, 2019 19:16
Change nav bar color on scroll
<!DOCTYPE html>
<!--[if lte IE 6]><html class="preIE7 preIE8 preIE9"><![endif]-->
<!--[if IE 7]><html class="preIE8 preIE9"><![endif]-->
<!--[if IE 8]><html class="preIE9"><![endif]-->
<!--[if gte IE 9]><!--><html><!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>title</title>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=font1|font2|etc" type="text/css">
@g-rohit
g-rohit / Hidden-pre-header-SSL.html
Created August 6, 2019 21:52
HTML email hidden - Preheader or SSL
<!-- Put this right after the opening tag of body -->
<div style="display:none; font-size:0px; color:#ffffff; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden;">
{{Your preheder here}}
&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&#160;&zwnj;&
@g-rohit
g-rohit / Remove-controls.js
Created August 8, 2019 19:57
Remove all control elements from Youtube video
// Paste this below code into the console on the youtube:
javascript:(function(){var goaway=".ytp-chrome-top,.ytp-chrome-bottom{display:none;}";if("\v"=="v"){document.createStyleSheet().cssText=goaway}else{var tag=document.createElement("style");tag.type="text/css";document.getElementsByTagName("head")[0].appendChild(tag);tag[(typeof document.body.style.WebkitAppearance=="string")?"innerText":"innerHTML"]=goaway}})();
//then you can take a full screen screenshot ;)
@g-rohit
g-rohit / desginemode.txt
Last active September 28, 2019 14:33
designmode on chrome
//document.querySelectorAll('*').forEach(e => e.contentEditable = 'true');
document.designMode = 'on'
@g-rohit
g-rohit / fa-pro.css
Last active November 20, 2019 21:34
fa-pro.css
/*!
* Font Awesome Pro 5.3.1 by @fontawesome - https://fontawesome.com*/
.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margi