Skip to content

Instantly share code, notes, and snippets.

@giacomopaita
giacomopaita / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@giacomopaita
giacomopaita / How to make showhide a non-child div
Last active August 29, 2015 14:16
How to make show/hide a non-child <div> when mouseenter/leave on a link
[class*="strip-header"] {
width: 100%;
overflow: hidden;
}
* {
font-family:'Century Gothic';
padding:0;
margin:0;
color:#E0B880
}
@giacomopaita
giacomopaita / Lazy Load FB Like
Last active February 18, 2017 00:02
Lazy Load Facebook Like Box
$('.tab a').on('click', function(){
if ($(this).html() == 'FACEBOOK' && typeof xx == 'undefined') {
// DUMMY VARIABLE TO CALL THE FUNCTION ONLY THE FIRST TIME THE USER CLICKS THE TAB:
xx = 1;
(function(d, s, id) {
var js;
var fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
@giacomopaita
giacomopaita / SASS Mixins
Last active August 29, 2015 14:07
MIxins Collection
// @include font-face($style-name, $file, $family, $category);
// $style-name being the name of the font e.g. Helvetica
// $file meaning the file name, without the file extensions
// $family being the folder inside the fonts folder where the font files are
// $category is serif or sans-serif or monospace etc. as a fall back in CSS
// Here with real values:
//
// @include font-face('Ashbury', 'AshburyLig-webfont', 'Ashbury', 'serif');
// use with iconmoon: https://icomoon.io/app/#/select/font
/*sinceHow
@Author Simone Luise
@Mail me@simoneluise.com
A simple function to calcunate how much time has elapsed since a date.
The funcion have only one attribute: "time".
Time must be a valid string for generate a new Data() object. Like:
@giacomopaita
giacomopaita / center-a-div-with-dynamic-width
Last active December 17, 2015 06:09
Css to center a <div> with dynamic width.
<div class="example">
<div class="outer">
<div id="centeredContent" class="inner">
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</div>
</div>
</div>