Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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;
}
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 / bilan-techdays2015.md
Last active August 29, 2015 14:15
Techdays 2015

Techdays 2015

Bilan des sessions MS.

@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 / .bashrc
Last active August 29, 2015 14:15
ComponentSpec
export PYTHONPATH=/c/Python27/
export GYP_MSVS_VERSION=2013
#Define the proxy variables.
export HTTPS_PROXY=http://proxy:port
export HTTP_PROXY=http://proxy:port
export no_proxy=localhost,otherdomain.lan.net
@pierr
pierr / line.js
Created February 18, 2015 16:19
Line
var ListMixin = require('list');
var lineRenderer = function(lineData){
return (<li></li>)
}
var ListMxin = ListMixin({Line: LineCustom}})
module.exports = React.createClass({
mixin: [ListMxin()],
@pierr
pierr / node-evn.sh
Last active August 29, 2015 14:15
node-production
echo 'define env variables'
APP_DIRECTORY=/path/directeory
PM2_BIN=node_modules/pm2/bin/pm2
PM2=$APP_DIRECTORY/PM2_BIN