Skip to content

Instantly share code, notes, and snippets.


Dhaval Vyas dhavalwd

Block or report user

Report or block dhavalwd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dhavalwd / .htaccess
Created Aug 15, 2019 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
dhavalwd / textWidth.js
Created Oct 24, 2017
textWidth function - calculate text width
View textWidth.js
// Copied from here:
// jQuery function to calculate text width
$.fn.textWidth = function(){
var html_org = $(this).html();
var html_calc = '<span>' + html_org + '</span>';
var width = $(this).find('span:first').width();
return width;
dhavalwd / flexbox.scss
Created Sep 29, 2017 — forked from richardtorres314/flexbox.scss
CSS Flexbox - Sass Mixins
View flexbox.scss
// --------------------------------------------------
// Flexbox SASS mixins
// The spec:
// --------------------------------------------------
// Flexbox display
@mixin flexbox() {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
View bootstrap-sass-mixin-cheatsheet.scss
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
dhavalwd / scrollto.js
Last active Aug 29, 2017
Easy Scroll to functions. Scroll within Body or scroll within parent element.
View scrollto.js
// For more information on this use below link.
// With Animation
jQuery.fn.scrollTo = function(elem, speed) {
scrollTop: $(this).scrollTop() - $(this).offset().top + $(elem).offset().top
}, speed == undefined ? 1000 : speed);
return this;
dhavalwd / multiFilter.js
Created Aug 25, 2017 — forked from jherax/filterArray.js
Filters an array of objects with multiple criteria.
View multiFilter.js
* Filters an array of objects with multiple criteria.
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria as the property names
* @return {Array}
function multiFilter(array, filters) {
const filterKeys = Object.keys(filters);
// filters all elements passing the criteria
You can’t perform that action at this time.