This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * * | |
* Avoid `console` errors in browsers that lack a console | |
* @extract of https://github.com/h5bp/mobile-boilerplate | |
*/ | |
(function(){var method;var noop=function(){};var methods=['assert','clear','count','debug','dir','dirxml','error','exception','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','table','time','timeEnd','timeStamp','trace','warn'];var length=methods.length;var console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop;}}}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SASS/SCSS, less or stylus | |
.children-class { | |
color: red; | |
.parent-class & { | |
color: green; | |
} | |
} | |
=> compile in CSS | |
.children-class { color: red } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GOOGLE MAPS | |
// ---------------------------- | |
/*jshint sub:true*/ | |
/*jshint indent:4 */ | |
var MyMap = { | |
data: { | |
mapItinerary: document.getElementById('map-itinary'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forbiddenCopy: function() { | |
$copy = $('.forbidden-copy'); | |
$copy.on('copy paste cut', function(e) { | |
e.preventDefault(); | |
return false; | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
centerBackground: function () { | |
if( !mobile ) | |
{ | |
var $back = $('#back-img img'); | |
var backSize = tablet ? 750 : 1490; | |
if( backSize >= Master.data.w ) | |
{ | |
var decalage = ( Master.data.w - backSize) / 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newString = oldString.substr(0,35) + ' [...] '; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* List to dropdown | |
* =================================== | |
*/ | |
o.listToDropdown = function () { | |
if(!o.device('m') || !$('.list-to-dropdown').length ) | |
return false; | |
// Create the dropdown base | |
$("<select />").appendTo(".list-to-dropdown .element-select"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fonction utilisé dans orderDataDOM | |
orderDOM: function(order, toOrder, dataName){ | |
toOrder.sort(function (a, b) | |
{ | |
a = parseInt( $( a ).data (dataName ), 10 ); | |
b = parseInt( $( b ).data( dataName ), 10 ); | |
if( order == 'asc' ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------- */ | |
/* ::: G R U N T ::: */ | |
/* ----------------- */ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[console.log( ${1} );]]></content> | |
<tabTrigger>console</tabTrigger> | |
<scope>source.js</scope> | |
<description>Console.log</description> | |
</snippet> |
OlderNewer