Skip to content

Instantly share code, notes, and snippets.

@internoma
internoma / ampersands.css
Created May 20, 2013 18:54
Ampersands con estilo
.amp {
font-family: Baskerville, 'Goudy Old Style', Palatino, 'Book Antiqua', serif;
font-style: italic;
font-weight: normal;
}
@internoma
internoma / target-blank.js
Created May 20, 2013 18:54
Añade target _blank a los enlaces externos
var root = location.protocol + '//' + location.host;
$('a').not(':contains(root)').click(function(){
this.target = "_blank";
})
@internoma
internoma / Asset.conf
Created May 20, 2013 18:54
Añade utf-8 charset automáticamente
# Añade utf-8 charset automáticamente
<FilesMatch "\.(htm|html|css|js|json|xml|atom|rss)$">
AddDefaultCharset UTF-8
DefaultLanguage es-US
</FilesMatch>
@internoma
internoma / htaccess.conf
Created May 20, 2013 18:54
Añadir soporte para imágenes svg
# Añadir soporte para imágenes svg
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
@internoma
internoma / Asset.php
Created May 20, 2013 18:54
Array de sub-carpetas de una carpeta
<?php
function listdir($dir){
if ($handle = opendir($dir)){
$output = array();
while (false !== ($item = readdir($handle))){
if (is_dir($dir.'/'.$item) and $item != "." and $item != ".."){
$output[] = $dir.'/'.$item;
$output = array_merge($output, ListDescendantDirectories($dir.'/'.$item));
}
}
@internoma
internoma / background-responsive.css
Created May 20, 2013 18:54
Background image scalable
html {
background: url(bg.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
@internoma
internoma / bolerplate-mediaQueries.css
Created May 20, 2013 18:54
Boilerplate CSS Media Queries
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-width : 320px)
and (max-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@internoma
internoma / index.html
Created May 20, 2013 18:54
Bootstrap - Carrousel
<!--Comienzo del código para pase de imágenes (Carrusel)-->
<div id="__miCarrusel__" class="carousel slide">
<!-- indicadores de elementos -->
<ol class="carousel-indicators">
<li data-target="#__miCarrusel__" data-slide-to="0"></li>
<li data-target="#__miCarrusel__" data-slide-to="1" class="active"></li>
<li data-target="#__miCarrusel__" data-slide-to="2"></li>
</ol>
@internoma
internoma / index.html
Created May 20, 2013 18:54
Bootstrap - Inicialización
<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<title>__TITLE__</title>
<!-- Bootstrap css -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
@internoma
internoma / index.html
Created May 20, 2013 18:54
Bootstrap - Ventana modal
<!--Botón de apertura de ventana modal #miVentana-->
<a class="btn btn-info" data-toggle="modal" href="#miVentana" >Abrir ventana modal...</a>
<div class="modal hide fade" id="miVentana" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <!--Definición ventana modal-->
<div class="modal-header"> <!--Cabecera ventana modal-->
<a class="close" data-dismiss="modal">×</a>
<h3>Cabecera ventana</h3>
</div>