Skip to content

Instantly share code, notes, and snippets.

@pierr
pierr / routes.md
Last active October 15, 2015 14:27
Routes

Règle de nommage des routes

  • On met le nom de l'entité au pluriel.
  • On ne termine pas une route par /
  • Les actions sur une entité sont suffixé par ()
  • Les paramètres de tri et de pagination sont des paramètres d'URL
Element Action format verbe exemple
Liste Chargement /entities GET /commandes
@pierr
pierr / bilan-techdays2015.md
Last active August 29, 2015 14:15
Techdays 2015

Techdays 2015

Bilan des sessions MS.

var turnoverPeriodAutoComplete = function turnoverPeriodAutoComplete(query) {
if (query !== undefined) {
var countryId = null;
if (query.element !== undefined) {
countryId = query.element[0].getAttribute('data-cty');
}
query.limit = 12;
Service.loadTurnoverPeriodListByCountryId(query.id, countryId, query.page, query.limit).then(function (results) {
Fmk.Helpers.select2Helper.autocompleteCallback(query, results);
@pierr
pierr / modal.css
Created December 17, 2014 10:34
modal.css
/*body{
color: @gray;
font-family: 'Helvetica', arial;
height: 80em;
}
.wrap{
padding: @space;
text-align: center;
}
@pierr
pierr / check_box_for.coffee
Last active August 29, 2015 14:11
select-inline
checkbox_for = (property, options) ->
options.css = options.css or ""
options.domain = options.domain or ""
html = "
<div class='checkbox #{options.css}' data-domain='#{options.domain}'>
<label>
<input type='checkbox' data-name='#{property.name}' #{if property.value then "checked" else ""}> #{options.label}
</label>
</div>
"
@pierr
pierr / appcache.js
Created December 12, 2014 15:05
offline
/*global window, i18n*/
/**
* Enregistre l'évènement de mise à jour de l'application cache.
* @return {function}
*/
module.exports = {
initialize: function() {
window.addEventListener("load", (function() {
return window.applicationCache.addEventListener("updateready", (function() {
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
@pierr
pierr / percent-jquery.js
Last active August 29, 2015 14:11
formatter
function(){
if(!jQuery){
throw new Error('JQuery should be define');
}
$.fn.percentify = function(options){
function parseValue(value){
//Code à faire pour parser la valeur.
return value.slice(0,-1);
}
@pierr
pierr / .bashrc
Created December 5, 2014 08:56
node modules path windows
PATH=/c/Users/{userName}/AppData/Roaming/npm/:$PATH
@pierr
pierr / defaultOptions.js
Last active August 29, 2015 14:10
Focus view options
{
/**
* Does the view has to load the model from the service define in `getModelSvc`.
* @type {Boolean}
*/
isModelToLoad: true, //By default the model is loaded.
/**
* If true, there is an edit mode in the view.
* @type {Boolean}
*/