I hereby claim:
- I am sidisinsane on github.
- I am sidisinsane (https://keybase.io/sidisinsane) on keybase.
- I have a public key ASBxKGSW70T8EFlEy_PTCQbhGIUyVv13PKUE1laZZIzIigo
To claim this, I am signing this object:
######################################################################################## | |
# store requested protocol in %{ENV:protocol} | |
######################################################################################## | |
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.*)$ - [env=protocol:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ - [env=protocol:http] | |
######################################################################################## | |
# force non www |
######################################################################################## | |
# force trailing slash | |
######################################################################################## | |
RewriteCond %{REQUEST_URI} /+[^\.]+$ | |
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L] |
######################################################################################## | |
# store requested protocol in %{ENV:protocol} (i always use this...) | |
######################################################################################## | |
RewriteCond %{HTTPS} =on | |
RewriteRule ^(.*)$ - [env=protocol:https] | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ - [env=protocol:http] | |
######################################################################################## | |
# placeholder redirects (exclude specific matching redirects!) |
// --- | |
// Revokes formatting previously applied by ‘Intl.NumberFormat‘ | |
// | |
// Usage: | |
// '123.456,78'.revokeIntlNumberFormat('de-DE'); | |
// Result: | |
// 123456.78 | |
// --- | |
Object.defineProperty(Object.prototype, 'revokeIntlNumberFormat', { | |
value: function(locale) { |
function trimSvgWhitespace() { | |
// get all SVG objects in the DOM | |
var svgs = document.getElementsByTagName("svg"); | |
// go through each one and add a viewbox that ensures all children are visible | |
for (var i=0, l=svgs.length; i<l; i++) { | |
var svg = svgs[i], | |
box = svg.getBBox(), // <- get the visual boundary required to view all children |
I hereby claim:
To claim this, I am signing this object:
Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.
This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.
Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you
.animated-multiline-underline { | |
display: inline; | |
text-decoration: none; | |
width: calc(100%); /* somehow ie edge seems to need this */ | |
background-image: linear-gradient(transparent calc(100% - 1px), currentColor 100%); | |
background-position: bottom left; | |
background-repeat: no-repeat; | |
background-size: 0% 1px; | |
-webkit-transition: background-size 300ms linear; | |
transition: background-size 300ms linear; |
/** | |
* Format a number while typing it into an input field. | |
* | |
* @function formatNumberOnInput | |
* @param {!Element} element - The input element to format. | |
* | |
* @example | |
* | |
* formatNumberOnInput(document.getElementById('foo'); | |
*/ |
/** | |
* Detect a click outside of an element and run a callback function. | |
* | |
* @function clickedOutside | |
* @param {!Element} element - The element for which to detect an outside click. | |
* @param {!Function} callback - The callback function to run when a click outside is detected. | |
* | |
* @example | |
* | |
* clickedOutside(document.getElementById('foo'), function(e) { |