Skip to content

Instantly share code, notes, and snippets.

View i-arindam's full-sized avatar
💭
I may be slow to respond.

Arindam Chakraborty i-arindam

💭
I may be slow to respond.
  • Bangalore, India
  • 00:14 (UTC +05:30)
View GitHub Profile
@trantorLiu
trantorLiu / handlebars-pagination-helper.js
Last active December 2, 2024 13:20
Handlebars pagination helper.
Handlebars.registerHelper('pagination', function(currentPage, totalPage, size, options) {
var startPage, endPage, context;
if (arguments.length === 3) {
options = size;
size = 5;
}
startPage = currentPage - Math.floor(size / 2);
endPage = currentPage + Math.floor(size / 2);
@larrybotha
larrybotha / A.markdown
Last active May 1, 2025 17:28
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.