Skip to content

Instantly share code, notes, and snippets.

View erika-carvalh0's full-sized avatar
🎯
Focusing

Erika Carvalho erika-carvalh0

🎯
Focusing
View GitHub Profile
/* Use clip-path directly at the image
Source: https://css-tricks.com/clipping-masking-css/
*/
img {
clip-path: circle(50% at center);
}
/* Just add the next line to the HTML element (or the one you want)
Source: https://www.w3schools.com/howto/howto_css_smooth_scroll.asp
*/
html {
scroll-behavior: smooth;
}
http://scrollmagic.io
// Internet Explorer 10 & 11 : Create a media query using -ms-high-contrast, in which you place your IE 10 and 11-specific CSS styles. Because -ms-high-contrast is Microsoft-specific (and only available in IE 10+), it will only be parsed in Internet Explorer 10 and greater.
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
}
<!-- If you use an input type=text but wants to force mobile devices to show the numeric keyboard, use the inputmode attribute -->
<input inputmode="numeric" type="text" maxlength="24">
// Format money as 0.000,00
function setCurrencyFormat( number ) {
return parseFloat(number, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1.").replace(/(\.)(\d{2})$/,",$2")
}
var $loja = { loja: 'Name of the Store', endereco: 'Here goes the Address' }
// APPEND HERE
<iframe frameborder="0"
src="https://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=' + $loja['loja'] + '-' + $loja['endereco'] + '&z=14&output=embed" class="mg-top-pequena" width="100%" height="300" frameborder="0" style="border:0" allowfullscreen>
</iframe>
@erika-carvalh0
erika-carvalh0 / sort-object-properties-by-value.md
Created April 22, 2019 17:26 — forked from umidjons/sort-object-properties-by-value.md
JavaScript: sort object properties by value (numeric or string)

Sort object properties by value (values are text)

I have following object:

var cities={10:'Tashkent', 14:'Karakalpakiya', 16:'Andijan'};

I want sort it by city names, so after sort it should be:

var cities={16:'Andijan', 14:'Karakalpakiya', 10:'Tashkent'};

But I can't sort object properties, instead can convert object into array, then sort items.

<!-- For cases where you need to open a map -->
<a href="geo:50.066274, 10.754427;">
.container {
overflow: -webkit-paged-y;
}
.container .absolute-child {
position: absolute;
}