Javascript
P..... ! Mais c'est bien sûr ! Variables privées et héritage en javascript
Pour une lecture plus confortable : 2011-04-29-PRIVATE_VARS_JS.md sur GitHub
Annotations for JavaScript / Code snippet
For my own needs, I needed an annotation system for javascript functions. This is my (ugly) code and how to use it. If a "regex king" reads this, any kind of help is appreciated :)
the syntax is like that :
@@-MyAnnotation-
defaultValue:HELLO,
type:TEXT,
id:2345
@@
Code of Annotations function :
Demo :
Have a nice day. @+P
7 little things (in javascript)
Still no blog post (no time, no idea, but it will come), but this weekend I found this :
- Scheme : online Scheme interpretor with CoffeeScript : http://dmitrysoshnikov.com/coffee-lisp-eval/index.html
- Zepto.js v0.4 : THE smallest js framework from Thomas Fucks : v0.4 is out http://mir.aculo.us/2011/01/21/zepto-js-v0-4-%E2%80%93-jsonp-more-dom-goodness/, size is less than 5ko !!!
- Welcome to the land of fools : js code obfuscation "à la japonaise" ... et it runs ... crazy http://utf-8.jp/public/aaencode.html
- Load.js : dependencies management, js library loading ... too easy :
load('jquery.js').then('jquery-ui.js','jquery-ui-theme.js').then('myscript.js').thenRun(function () {alert('Loaded.');});https://github.com/chriso/load.js - Crafty : little js game framework (to follow) http://craftyjs.tumblr.com/
- Lawnchair : like CouchDb but in browser, by Brian Leroux (PhoneGap)
var people = new Lawnchair('people'); people.save({name:'frank'}, function(r) {console.log(r);});http://westcoastlogic.com/lawnchair/ - Mibbu : js game framework (not yet released) but have to follow http://mibbu.eu/ demo here http://openodyssey.mibbu.eu/
7 petites choses en javascript ...
Toujours pas d'articles (pas le temps, pas d'idée, ça va revenir), mais ce we j'ai trouvé ceci :
- Scheme : Un interpréteur Scheme en ligne avec CoffeeScript : http://dmitrysoshnikov.com/coffee-lisp-eval/index.html
- Zepto.js v0.4 : le framework js minimaliste de Thomas Fucks passe en v0.4 http://mir.aculo.us/2011/01/21/zepto-js-v0-4-%E2%80%93-jsonp-more-dom-goodness/, toujours moins de 5ko
- Bienvenue chez les fous : obfuscation de code js "à la japonaise" ... et ça fonctionne http://utf-8.jp/public/aaencode.html
- Load.js : gestion des dépendances, chargement de librairies javascript ... trop facile :
load('jquery.js').then('jquery-ui.js','jquery-ui-theme.js').then('myscript.js').thenRun(function () {alert('Loaded.');});https://github.com/chriso/load.js - Crafty : le petit framework de jeux en js qu'il faut suivre http://craftyjs.tumblr.com/
- Lawnchair : un peu comme CouchDb mais côté navigateur, par Brian Leroux (PhoneGap)
var people = new Lawnchair('people'); people.save({name:'frank'}, function(r) {console.log(r);});http://westcoastlogic.com/lawnchair/ - Mibbu : framework de jeux en js (pas encore sorti) mais à suivre http://mibbu.eu/ une demo ici http://openodyssey.mibbu.eu/
mu(inheritance) : smal(lest?) inheritance javascript framework
µ(inheritance) allows :
- inheritance between function (class)
- multi-inheritance (but not recommended ;-))
- to declare and use a constructor otherwise, you have an abstract class (unable to instantiate)
- calling parent constructor (constructor name = function (class) name)
- to test type of an object
- using private variables without side effects with inheritance
This source code (<30 lines of code) is largely inspired by those books :
- Javascript patterns - Stoyan Stefanov
- JavaScript : the Good Parts - Douglas Crockford
- Javascript cookbook - Shelley Powers
- Pragmatic Guide to JavaScript - Christophe Porteneuve
I was guided by three rules :
- module pattern
- functional inheritance pattern
- no prototype
and a "desire" : each class has a constructor (and be able to call her parent's constructor).
Explanation :
µ(inheritance) source code :
1ère WebApp pour iPad & iPhone - No Objective-C

Cela fait un moment que je n'ai rien "pondu", beaucoup de travail, beaucoup de R&D, dont pas mal de lectures à propos des technologies web sur nos jouets mobiles (j'entends par là : iPhone, iPad, mobiles Android, etc. ...
Du coup après plus d'un mois, je viens de passer un moment pour vous concocter un nouveau tuto.
Aujourd'hui, je vais vous parler des "webapps" (comment les réaliser). Une webapp est une application construite à l'aide d'HTML (5), CSS (3) et javascript. Elles ont la particularité d'être "installables" et de se comporter comme une véritable application sur un terminal mobile, ainsi que de pouvoir fonctionner en mode "offline".
- Vous n'êtes pas obligés de passer par l'Appstore pour les distribuer.
- Vous n'êtes pas obligés d'avoir un MAC pour coder.
- Vous n'êtes pas obligés de connaître Objective-C
Au final vous pouvez construire une application qui n'a rien à envier à certaines applications natives.
Voyons donc voir comment faire, le document est par ici : 1ère WebApp.
Bonne lecture et bon dimanche.
@+ Philippe


Recent comments
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 51 weeks ago
1 year 52 weeks ago
1 year 52 weeks ago
1 year 52 weeks ago
1 year 52 weeks ago