Skip to content

Instantly share code, notes, and snippets.

View rhythmpatel's full-sized avatar
🏠
Working from home

Rhythm Ruparelia rhythmpatel

🏠
Working from home
  • Rajkot, Gujarat
  • 11:20 (UTC +05:30)
View GitHub Profile
@rhythmpatel
rhythmpatel / README.md
Created June 12, 2021 13:13 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@rhythmpatel
rhythmpatel / smooth-scroll.js
Created September 8, 2020 05:39
Smooth scroll to a specific section on another page
window.onload = function() {
if (window.location.hash)
scroll(0,0);
setTimeout(function(){scroll(0,0);},1); // fix for some browser issues
smoothScroll();
}
function smoothScroll() {
MAIL_DRIVER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
// Check on port: 8025
let path = window.location.pathname.split("/")[1];
// for parent menu items
$('.navbar-nav > li > a[href="'+path+'"]').parent()
.addClass('active');
// for dropdown items - highlights both dropdown item and parent link
$('.dropdown-menu > a[href="'+path+'"]')
.addClass('active')
.parents('.nav-item').addClass('active');
@rhythmpatel
rhythmpatel / static-loop.js
Last active January 16, 2020 06:25
Static loop to use in React - JSX.
[...Array(5).keys()].map((question, index) => {
return (
/* HTML/JSX here */
)
})
@rhythmpatel
rhythmpatel / commit-message-format.md
Last active December 23, 2019 10:03 — forked from develar/commit-message-format.md
Commit Message Format

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
@rhythmpatel
rhythmpatel / html-styles
Last active November 15, 2018 13:57
CSS to prevent font scaling in landscape and proper font weights in Mac
html {
-webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@rhythmpatel
rhythmpatel / _bootstrap-sass-xl.scss
Created December 6, 2017 13:19 — forked from juukie/_bootstrap-sass-xl.scss
Add xl step to bootstrap sass. Should be after bootstrap.scss.
/* Place this after bootstrap.scss */
$screen-xl: 1560px !default;
$screen-xl-min: $screen-xl !default;
$screen-xl-desktop: $screen-xl-min !default;
$screen-lg-max: ($screen-xl-min - 1) !default;
$container-xlarge-desktop: (1530px + $grid-gutter-width) !default;
$container-xl: $container-xlarge-desktop !default;
.container {
@rhythmpatel
rhythmpatel / keymap.json
Created March 27, 2017 05:18
Custom shortcut keys for code expand/collapse in Brackets
{
"documentation": "https://github.com/adobe/brackets/wiki/User-Key-Bindings",
"overrides": {
"Ctrl-Alt-C":"codefolding.collapse",
"Ctrl-Alt-X":"codefolding.expand"
}
}
@rhythmpatel
rhythmpatel / pop-stay.js
Last active April 7, 2017 07:05
BS Popover
/* Bootstrap Popover on hover
* Problem: When the user moves the mouse on the popover, it should not close
* Solution from fiddle - http://jsfiddle.net/WojtekKruszewski/Zf3m7/22/
*/
var originalLeave = $.fn.popover.Constructor.prototype.leave;
$.fn.popover.Constructor.prototype.leave = function(obj){
var self = obj instanceof this.constructor ?
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
var container, timeout;