Skip to content

Instantly share code, notes, and snippets.

View orioltf's full-sized avatar

Oriol Torrent Florensa orioltf

View GitHub Profile
@orioltf
orioltf / osx_automount_nfs.md
Created April 29, 2014 15:07 — forked from L422Y/osx_automount_nfs.md
#TERMINAL: OSX automount

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@orioltf
orioltf / compare_dates.js
Last active April 17, 2022 07:40
#JS: create date objects with custom date formats
var startBookDate = $(this).find('input.startdate').val(),
endBookDate = $(this).find('input.enddate').val(),
startBookDateObj, endBookDateObj,
startSeasonDateObj, endSeasonDateObj;
// use function parseDate() own function to get a new Date object from a custom string format, cause the format delivered from the datePicker is Swiss date friendly
// Then use the JS Date function and its "parse" method to get a number (of milliseconds) to be able to compare dates.
startBookDateObj = Date.parse( parseDate(startBookDate) );
endBookDateObj = Date.parse( parseDate(endBookDate) );
@orioltf
orioltf / ES5 class.js
Created August 16, 2021 06:40 — forked from apal21/ES5 class.js
Example for blog to show the difference between ES5 and ES6 javascript classes using inheritance and prototypes use cases.
'use strict';
/**
* Person class.
*
* @constructor
* @param {String} name - name of a person.
* @param {Number} age - age of a person.
* @param {String} gender - gender of a person.
*/
@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 / check_vars_haml.md
Last active July 6, 2019 23:45
#HAML: Checking variables in partials
  1. Check if a page variable has been defined
    1. Set variables in a page (page.html.haml) at the very biginning of the file:

      ---
      variable: value
      variable2: value 2
      ---
@orioltf
orioltf / index.html
Last active May 17, 2018 07:56
#RESPONSIVE #HTML5 #JQUERY: Simple jQuery responsive cross-fade slider
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>The simplest responsive slider</title>
<meta name="description" content="">
@orioltf
orioltf / console-utils.js
Created November 28, 2013 12:34
Create shortcut to console.log() in Chrome
var log = console.log.bind(console);
var warn = console.warn.bind(console);
var info = console.info.bind(console);
var error = console.error.bind(console);
var table = console.table.bind(console);
@orioltf
orioltf / readme.md
Last active December 23, 2015 10:19
#HTML #HAML: Icon sizes snippet from new iOS7
  • The new OS7 icons are 5% bigger than in previous version.
  • System icons are flat now: apple doesn’t add shiny effect anymore.
  • apple-touch-icon precomposed is still supported but it will make same results as the apple-touch-icon
  • apple-touch-icon precomposed icon take precedence over apple-touch-icon
  • Available sizes according to apple:
    • iPhone / iPod Touch retina: 120×120
    • iPad non-retina (iPad 2 and iPad mini): 76×76
    • iPad retina: 152×152
  • Appple documentation
@orioltf
orioltf / loadDescFrontendConf.js
Created August 27, 2013 08:17
#JQUERY #WebEnhancer: Get whole description from each "more" link in FrontendConf via AJAX
var $talks = $('.schedule').find('article.talk');
$talks.each(function(){
$(this).on('click', 'p > a', function(e){
e.preventDefault();
var linkRef = $(this).attr('href'),
urlHash = linkRef.substring(linkRef.indexOf('#')),
urlWithoutHash = linkRef.substr(0,linkRef.indexOf('#')),
$container = $(this).closest('p');
@orioltf
orioltf / github.com.css
Created August 22, 2013 14:01
#CSS #WebEnhnacer: Change Github appearance to better use big screens (while still working on smaller ones). Add theese CSS changes to Stylish Chrome/Firefox extensions or similar ones. The filename shows where should be applied.
.container {
width: auto;
max-width: 100em;
}
/* Block formating context */
.repository-with-sidebar .repository-content,
.repository-with-sidebar.with-full-navigation .repository-content,
.discussion-timeline,
body.page-profile .profilecols .last,