Skip to content

Instantly share code, notes, and snippets.

View orioltf's full-sized avatar

Oriol Torrent Florensa orioltf

View GitHub Profile
@orioltf
orioltf / semantic_breadcrumb.html
Created July 25, 2012 17:32
#HTML5 #MICRODATA: Creating a semantic breadcrumb using HTML5 microdata
<ol class="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/" itemprop="url">
<span itemprop="title">Example.com</span>
</a>
</li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="http://www.example.com/news" itemprop="url">
<span itemprop="title">News</span>
</a>
@orioltf
orioltf / explain.md
Last active October 9, 2015 00:37
#OSX #LION: Desactiva el panel de guardar per defecte a iCloud i retorna al del Finder

TextEdit, Numbers, Keynote, Pages, Pixelmator, Vista Previa… todas estas aplicaciones tienen en común el nuevo cuadro de diálogo para abrir y guardar archivos directamente en iCloud. Este panel, de hecho, aparece por defecto en vez del clásico panel desde el que podíamos navegar por las carpetas del Mac para poder guardar los cambios o abrir un archivo que esté almacenado en el ordenador, y aunque todo el mundo esté adoptando iCloud a lo mejor nos interesa que el diálogo de iCloud no sea el que aparezca por defecto.

Apple no da la opción para cambiar eso directa y fácilmente, pero por suerte tenemos un comando del terminal que nos lo puede hacer. Es posible que al escribirlo os pida la contraseña de administrador:

defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false

De este modo el diálogo para abrir o guardar un archivo en iCloud se mantendrá en segundo plano y será el diálogo con el Finder de toda la vida el que nos aparecerá por defecto. Por supuesto, podemos revertir los

@orioltf
orioltf / style.scss
Last active October 10, 2015 22:38
#CODEPEN #WIDGET #SCSS: Social Switchbook. Pretty simple draft with transform rotate. FontAwesome for icons.
@import "compass";
@import url(http://fonts.googleapis.com/css?family=Ubuntu);
* { box-sizing: border-box; }
body {
overflow: hidden;
background:#c6c6c6;
-webkit-font-smoothing: antialiased;
}
@orioltf
orioltf / my_jquery_plugin_boilerplate.js
Created December 5, 2012 16:11
#JQUERY: My jQuery plugin boilerplate
/*
* Project :
* Description :
* Author :
* License :
*/
// the semi-colon before function invocation is a safety net against concatenated
// scripts and/or other plugins which may not be closed properly.
;(function($, window, document, undefined) {
@orioltf
orioltf / jqplugin.sublime-snippet
Created December 5, 2012 16:14
#JQUERY #SUBLIME: my jQuery plugin boilerplate as sublime snippet
<snippet>
<content><![CDATA[
/*
* Project : ${1}
* Description : ${2}
* Author : ${3:Oriol Torrent Florensa @ Unic AG}
* License : ${4:All rights reserved} ${5:Client Name}
*/
// the semi-colon before function invocation is a safety net against concatenated
@orioltf
orioltf / css_tables_polifyll.html
Last active December 11, 2015 04:58
#JQUERY #CSS: Using jQuery To Detect CSS-Based Table Display Capabilities. From http://www.bennadel.com/blog/1768-Using-jQuery-To-Detect-CSS-Based-Table-Display-Capabilities.htm
<!DOCTYPE HTML>
<html>
<head>
<title>
Detecting CSS-Based Table Display Support With jQuery
</title>
<style type="text/css">
div.table {
display: table ;
width: 100% ;
@orioltf
orioltf / script.js
Created January 18, 2013 12:26
#JS: iOS detection. Adds an "ios" class to <html> if device is iOS
if ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ) {
document.documentElement.className += " ios";
}
@orioltf
orioltf / Plain_Text_Editor_with_save_button.html
Created January 31, 2013 12:44
#BOOKMARK: Convert browser into a Plain Text Editor with save button
data:text/html;charset=utf-8,
<html>
<head>
<title>Plain Text Editor</title>
<style>
html{background-color: #f2f2f2;}
body{background-color: #fff; margin:1.5rem auto; max-width: 80rem;}
body, textarea {font-size: 1rem; line-height: 1.4;}
textarea {border: none; height: 90%; width: 100%;}
</style>
@orioltf
orioltf / Plain_Text_Editor_with_preview_and_save_button.html
Created January 31, 2013 14:56
#BOOKMARK: Convert browser into a Plain Text Editor with live preview and save button
data:text/html;charset=utf-8,
<html>
<head>
<title>Plain Text Editor</title>
<style>
html{background-color: #f2f2f2;}
body{background-color: #fff; margin:0; font-size: 1rem; line-height: 1.4; background-color: rgba(0,0,0,0.1);}
pre {margin: 0; width: 38%; padding: 0 1em;}
iframe {border: none; width: 56%; background-color: #fff;}
pre, iframe {float: left; height: 100%;}
@orioltf
orioltf / auto_resize_textarea.html
Last active December 12, 2015 05:28
#JQUERY: Autoresize textarea. The textarea will resize itself automatically as you add/remov content. For sure can be improved! http://codepen.io/orioltf/pen/euImv
<textarea id="comment" rows="0" cols="50"></textarea>