Skip to content

Instantly share code, notes, and snippets.

View kabilashgit's full-sized avatar

kabilash kabilashgit

  • Autumn Worldwide
  • Bangalore
View GitHub Profile
@kabilashgit
kabilashgit / keyframe-mixin.md
Last active March 20, 2019 11:33
Mixin to create css animation keyframes

/* Author : Manikandan K */

mixin to create css animation keyframes

@mixin keyframes($animation-name) {
  @-webkit-keyframes #{$animation-name} {
    @content;
 }
@kabilashgit
kabilashgit / media-query-mixin.md
Created March 20, 2019 11:57
media query mixin

/* Author : Manikandan K */

media query mixin

Bootstrap 4 breakpoints and my custom breakpoints

$grid-breakpoints: (
xs: 0,
sm: 575px,
@kabilashgit
kabilashgit / Add crossbrowser vendor prefix.md
Created March 20, 2019 12:15
Mixin to add crossbrowser vendor prefix to style property

add crossbrowser property (not for all styles)

mixin

@mixin crossBrowser($property, $val) {
  #{$property}: #{$val};
  -webkit-#{$property}: #{$val};
  -moz-#{$property}: #{$val};
  -ms-#{$property}: #{$val};
  -o-#{$property}: #{$val};
}
@kabilashgit
kabilashgit / add gradient text.md
Created March 20, 2019 12:15
Mixin to add gradient text

mixin for gradient text

mixin

@mixin gradient-text() {
  background: linear-gradient(70deg, #ef0866, #ff1e0c, #ef0866); //use any color
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
@kabilashgit
kabilashgit / MutationObserver.md
Created March 20, 2019 12:26
Listen DOM changed using MutationObserver

/* Author : Manikandan K */

Listen DOM changed using MutationObserver

MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

var observer = new MutationObserver(function(mutations, observer) {
 // fired when a mutation occurs
@kabilashgit
kabilashgit / htaccess.md
Last active December 10, 2019 13:46
www to non www with https

www to non www with https

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@kabilashgit
kabilashgit / htaccess.md
Last active April 17, 2019 07:41
Url rewriting for hiding folder name and open it without folder name

eg: http://example.com/foldername (to) http://example.com

Keep this rule in root .htaccess:

RewriteEngine On

RewriteRule ^(?!foldername/)(.*)$ foldername/$1 [L,NC]

Then have this simplified code in /fodlername/.htaccess:

@kabilashgit
kabilashgit / reset.css
Created May 15, 2019 17:18 — forked from simonausten/reset.css
Email CSS Reset
<style type="text/css">
/****** EMAIL CLIENT BUG FIXES - BEST NOT TO CHANGE THESE ********/
.ExternalClass {
width: 100%;
}
/* Forces Outlook.com to display emails at full width */
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; }
/* Forces Outlook.com to display normal line spacing, here is more on that: http://www.emailonacid.com/forum/viewthread/43/ */
@kabilashgit
kabilashgit / htaccess.md
Last active February 5, 2020 11:44
force https with www to any url
RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
@kabilashgit
kabilashgit / file-rename-lowercase.md
Last active April 29, 2024 16:03
rename all files to lower-case in windows

Rename all files in the directory to lowercase

open command line in that direct and run the following command

for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")

replace all subfolder files to lowercase

for /f "Tokens=*" %g in ('dir /b') do (for /f "Tokens=*" %f in ('dir %~fg /l /b /a-d') do (rename "%~fg\%f" "%f"))