Skip to content

Instantly share code, notes, and snippets.

@pierr
pierr / localstorageSize.js
Last active November 2, 2017 11:33
localstorageSize.js
/* Process the occupied size in the local storage.
* @return {localstorageSize} [description]
*/
function processLocalStorageSize() {
var total = 0;
for (var x in localStorage) {
total += (localStorage[x].length * 2) / 1024 / 1024;
//console.log(x + " = " + amount.toFixed(2) + " MB");
}
return total.toFixed(2) + " MB";
@pierr
pierr / .bashrc
Last active August 29, 2015 14:18
dotfiles
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
{
"movId": 220005,
"title": "Bokura no jidai",
"released": "2012-04-22T00:00:00.000Z",
"year": 2007,
"metadasJson": "\"Bokura no jidai\" (2007) {Shun Oguri, Tôma Ikuta \u0026 Masaki Okada 1/2}",
"rank": 220005,
"actors": [
{
"peoId": 5169769,
@pierr
pierr / 1-recuperer.md
Last active August 29, 2015 14:18
formation

Formation focus

Récupérer les sources:

git clone -b formation-detail https://github.com/KleeGroup/rodolphe-demo.git

@pierr
pierr / detail.jsx
Created June 2, 2015 09:54
detail.jsx
/*global React, Focus */
//Récupération des dépendances.
var createDetail = Focus.components.page.createDetail;
var Detail = Focus.components.common.detail.component;
//Blocs composants la page.
var MovieDetails = require('./movieDetails');
var Castings = require('./castings');
var MovieProducers = require('./movieProducers');
var MovieDirectors = require('./movieDirectors');
@pierr
pierr / packages.md
Created June 25, 2015 08:07
atom packages
@pierr
pierr / day1.md
Last active August 29, 2015 14:24
React Europe conference

Keynote

Le keynote est présenté par @vjeux, qui travaille chez Facebook. Il insiste sur le fait que React a pour but de se concentrer sur le V de MVC. Il explique que React est construit autour de deux principe:

  • Avoir la meilleure expérience utilisateur UX
  • Avoir la meilleure expérience pour le développeur DX

Il a ensuite donné la vision de React, les sujets importants:

  • Le routing avec React Routeur
@pierr
pierr / eslint.sh
Last active August 29, 2015 14:26
npm install --save-dev [email protected] babel-eslint eslint-plugin-react
@pierr
pierr / regex.md
Last active August 29, 2015 14:26

Regular expression are used for many things. It whould be complex to write code to check validation.

There is two part:

  • The string to search in
  • The regular expression
  • Regular erxpression starts and end with a //
  • The operator OR is |
  • It can matches letter or number or special character
  • There are used mainly for validation, searching, formatting
/**
<FileUpload>
{this.fieldFor('maProp')}
</Fileupload>
*/
module.exports = React.createClass({
render: function() {
return (
<form method='post' action={this.props.action} encType="multipart/form-data">