Skip to content

Instantly share code, notes, and snippets.

View LucaRosaldi's full-sized avatar

Luca Rosaldi LucaRosaldi

View GitHub Profile
@LucaRosaldi
LucaRosaldi / Elenco Province Italiane
Last active November 27, 2023 14:52
Elenco Province Italiane in vari formati: HTML, PHP, JSON, TXT, Pipe notation (es. Elementor).
# Fonte: Wikipedia
# URL: https://it.wikipedia.org/wiki/Province_d%27Italia
# Aggiornato al: 2022
Agrigento
Alessandria
Ancona
Aosta
Arezzo
Ascoli Piceno
@LucaRosaldi
LucaRosaldi / gist:3169842
Created July 24, 2012 13:08
PHP: Estimated Reading Time
<?php
// http://briancray.com/posts/estimated-reading-time-web-design/
$mycontent = $post->post_content; // wordpress users only
$word = str_word_count(strip_tags($mycontent));
$m = floor($word / 200);
$s = floor($word % 200 / (200 / 60));
$est = $m . ' minute' . ($m == 1 ? '' : 's') . ', ' . $s . ' second' . ($s == 1 ? '' : 's');
?>
@LucaRosaldi
LucaRosaldi / mq.css
Created October 8, 2012 07:20 — forked from chriscoyier/mq.css
CSS: Media Queries
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@LucaRosaldi
LucaRosaldi / icons.html
Last active October 11, 2015 11:18
CSS: Webfont Icons
<!-- Icon + Text -->
<h1>
<i data-icon="1" aria-hidden="true"></i>
Titolo
</h1>
<!-- Icon only -->
<h1 class="icon-alone">
<i data-icon="1" aria-hidden="true"></i>
<span>Titolo</span>
@LucaRosaldi
LucaRosaldi / gist:3938528
Created October 23, 2012 12:39
SASS: mixin vendorize()
@mixin vendorize($property, $value) {
-webkit-#{$property}: $value;
-moz-#{$property}: $value;
-ms-#{$property}: $value;
-o-#{$property}: $value;
#{$property}: $value;
}
@LucaRosaldi
LucaRosaldi / gist:3938537
Created October 23, 2012 12:41
SASS: mixin clear()
@mixin clear() {
&:before, &:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
}
&:after {
clear: both;
}
@LucaRosaldi
LucaRosaldi / gist:3938541
Created October 23, 2012 12:42
SASS: mixin hideText()
@mixin hideText() {
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@LucaRosaldi
LucaRosaldi / tucked-corners.css
Created November 5, 2012 17:09
CSS: Tucked Corners
/* http://www.red-team-design.com/css3-tucked-corners */
.tucked-corners-top {
position: relative;
width: 500px; min-height: 200px;
margin: 100px auto; padding: 20px;
background-color: #fff; /* Fallback */
background: linear-gradient(45deg, transparent 10px, #fff 10px),
linear-gradient(135deg, transparent 10px, #fff 10px),
linear-gradient(225deg, transparent 10px, #fff 10px),
linear-gradient(315deg, transparent 10px, #fff 10px);
@LucaRosaldi
LucaRosaldi / svg-fallback.css
Created November 20, 2012 10:15
jQuery: SVG fallback
.my-class {}
.svg .my-class { background:url(../img/graphic.svg); }
.no-svg .my-class { background:url(../img/graphic.png); }
@LucaRosaldi
LucaRosaldi / breakpoint-usage.scss
Created November 22, 2012 09:00
SASS: mixin breakpoint()
// http://css-tricks.com/media-queries-sass-3-2-and-codekit/
.page-wrap {
width: 75%;
@include breakpoint(papa-bear) { width: 60%; }
@include breakpoint(mama-bear) { width: 80%; }
@include breakpoint(baby-bear) { width: 95%; }
}