Code By
Lucas Mouilleron

An Open Source selection

cloudImageRecognition

Last update : 23/11/2015 - 15:27

A cloud image recognition test.
Using the moodstocks.com cloud service.

Screenshot

Features

  • add / remove images
  • search with image upload

socketIOBoilerplate

Last update : 23/11/2015 - 15:17

A nice and simple socketIO boilerplate.
Features a demo web multi screen web app.

Screenshot

Features

  • A nice and simple socketIO boilerplate
  • Client master / Client slave / Server relationship
  • Stack : socketIO, node, scss, requirejs
  • Build : install, build, watch, grunt, bower

Install requirements

  • Install NodeJS : http://nodejs.org/download
  • sudo gem install compass
  • sudo npm install bower -g
  • sudo npm install grunt -g
  • sudo gem install sass
  • sudo gem install --pre sass-css-importer

Install

  • cd _build && npm install

Build

  • Modify client-master/_dev/js/libs/config.js
  • Modify client-slave/_dev/js/libs/config.js
  • Modify server/libs/config.json
  • cd client-master/_build && grunt build
  • cd client-slave/_build && grunt build

Run

TODO

  • JWT authentication (via middleware)

Credits

Thanks to the guys at http://socket.io

phonegapBoilerplate

Last update : 23/11/2015 - 15:10

An basic phonegap boilerplate.

Screenshot

Install requirements

  • Install NodeJS : http://nodejs.org/download
  • sudo npm install -g phonegap
  • sudo npm install grunt -g

Install

  • iOS :
    • sudo npm install -g ios-deploy && sudo npm install -g ios-sim
    • test : phonegap run ios
  • Android :
    • Download the Android SDK : https://developer.android.com/sdk
    • Edit path :
      • export ANDROID_HOME=$HOME/Library/Android
      • export PATH=$PATH:$ANDROID_HOME/tools
    • Launch Android SDK manager : android
    • Install packages (SDK + images)
    • Tools -> Manage AVDs and create a device
    • test : phonegap run android
  • Plugins are installed from _build/config.json->installCommands
  • cd _build && npm install && grunt install

Run

  • iOS :
    • cd _build && grunt run:ios
    • Edit _build/config.json->phonegapiOSTarget to change simulated device
    • Valid options are :
      • iPhone (Retina 3.5-inch)
      • iPhone (Retina 4-inch)
      • iPhone
      • iPad
      • iPad (Retina)
  • Android :
    • cd _build && grunt run:android
    • edit _build/config.json->phonegapAndroidTarget to change simulated device
    • Valid options are AVD name configured with the Android SDK mangaer : android
    • Tested only API 21 - Google Nexus

Doc

  • Config.xml :
    • http://docs.build.phonegap.com/enUS/2.9.0/configuringbasics.md.html#The%20Basics
    • http://docs.build.phonegap.com/enUS/2.9.0/configuringpreferences.md.html
  • Plugins :
    • http://docs.phonegap.com/en/3.5.0/cordovapluginspluginapis.md.html#Plugin%20APIs
  • Miscs :
    • scaffholder : phonegap create . com.lucasmouilleron.phonegapAngularBoilerplate phonegapAngularBoilerplate

Todo

  • More plugins (camera, etc.)
  • build.phonegap.com

webAppSnapshotBoilerplate

Last update : 23/11/2015 - 14:46

A simple phantomJS snapshot generator for web app.

Screenshot

Features

  • Snapshot generation for angular app with phantomJS
  • Detect Google requests (with htaccess and escape_fragment) and servers the html snasphot instead of the web app
  • Auto generation on Google request if snapshot does not exist
  • Sample angular web app

Install

  • Apache + PHP 5
  • Install NodeJS : http://nodejs.org/download
  • cd server && npm install
  • cd server && vi config.json :
    • envPath : paste the result of echo $PATH
    • baseURL : the base URL of the app
  • cd webApp && npm install && grunt build
  • cd webApp && vi .htaccess : edit the RewriteBase

Tests

  • Manually generate snaphots :
    • make-snapshot http://localhost.com/webAppSnapshotBoilerplate/webApp/#!/reddits
    • make-snapshot http://localhost.com/webAppSnapshotBoilerplate/webApp/#!/github/lucasmouilleron
  • Get snapshot, like Google would do it :
    • http://localhost.com/webAppSnapshotBoilerplate/webApp/?escapedfragment_=/reddits
    • http://localhost.com/webAppSnapshotBoilerplate/webApp/?escapedfragment_=/github/lucasmouilleron
  • Scaffhold for background snapshot generation
  • Remove php dependencie
  • Alert in server/phantomjs-runner.js
  • Alert in server/snapshots/index.php

slimBoilerplate

Last update : 22/11/2015 - 19:00

Slim is a lightweight but powerfull API Rest PHP framework.

Screenshot

Features

  • A nice slim boilerplate
  • Stack : slim, php, SimpleCache, JWT authentication
  • Build : install, build, watch, grunt, bower

Install requirements

  • Install NodeJS : http://nodejs.org/download
  • sudo npm install bower -g
  • sudo npm install grunt -g
  • sudo gem install sass
  • sudo gem install --pre sass-css-importer
  • Install composer :
    • curl -sS https://getcomposer.org/installer | php
    • mv composer.phar /usr/local/bin/composer

Install

  • cd api && composer install
  • cd build && npm install

Run and tests

  • little JS app at index.php and _dev/js
  • php requests at test.php

TODO

  • edit api/libs/JWTAuthenticationMiddleware.php > JWTAuthenticationMiddleware->doLogin to add login logic

Credits

Thanks to guys at Slim

TCTBlog

Last update : 10/11/2015 - 18:16
  • Everything is in gh-pages branch
  • Needed for github pages publication
  • To edit the blog, switch to gh-pages branch

TSSocketTest

Last update : 21/04/2015 - 12:00
Private repository :(

requireJSBoilerplate

Last update : 18/02/2015 - 15:33

Features

  • A nice frontend requireJS boilerplate
  • Stack : requirejs, compass, bootstrap, fontawesome
  • Build : install, build, watch, grunt, bower

Install requirements

  • Install NodeJS : http://nodejs.org/download
  • sudo gem install compass
  • sudo npm install bower -g
  • sudo npm install grunt-cli -g
  • sudo npm install grunt -g
  • sudo gem install sass
  • sudo gem install --pre sass-css-importer

Install

  • cd _build && npm install
  • Possible to add custom install commands in config->installCommands

Build

  • modify _build/config.json if needed
  • cd _build && grunt build

Sync

  • cd _build
  • grunt sync

RequireJS

  • Debug mode :
    • Launch ndex-debug.html instead
    • index-debug.html loads the non compiled version

Bower

  • Add a requirejs module from bower :
    • cd _build && bower install the_module --save
    • Then, add path to _dev/js/libs/vendor/the_module/path/to/jsFile in _dev/main.js in path section and include module name in the requirejs call
  • Add a css from bower :
    • cd _build && bower install the_module --save
    • Then edit _dev/scss/main.scss and add @import "CSS:../js/libs/vendor/the_module/the_css_path/the_css_file_without_extension";
  • Add a public resource from bower :
    • cd _build && bower install the_module --save
    • Then edit build/config.json and update the copyFiles value so the files from the vendor path are copyied in the public assets folder

reactBoilerplate

Last update : 12/02/2015 - 18:32

Features

  • Based React, React-router and UIKit
  • Stack : browserify, reactify, scss

Install requirements

  • Install NodeJS : http://nodejs.org/download
  • sudo gem install compass
  • sudo npm install bower -g
  • sudo npm install grunt-cli -g
  • sudo npm install grunt -g
  • sudo gem install sass
  • sudo gem install --pre sass-css-importer

Install

  • npm install && grunt install

Build

  • edit config.json if needed
  • grunt build

TODO

  • github service
  • datamanagment
  • cf sql react github trending

testMongoDB

Last update : 31/01/2015 - 09:55

Install mongo server

  • brew install mongodb [Mac OS]
  • mkdir -p /path/to/data/db
  • sudo mongod --fork --logpath /var/log/mongodb.log --port 27017 --dbpath /path/to/data
  • UI : http://www.girbal.net/umongo

Authentication

  • Create admin user :
    • sudo mongod --fork --logpath /var/log/mongodb.log --port 27017 --dbpath /path/to/data
    • mongo --host the_host --port 27017
    • use admin
    • db.createUser({user: "admin", pwd: "iamagod", roles: [ "root" ]})
    • kill mongodb
    • sudo mongod ... --auth

Tables

  • mongo --username admin --password iamagod admin --authenticationDatabase admin
  • use main
  • db.shops.ensureIndex({"loc":"2dsphere"})
  • db.shops.ensureIndex({"name":"text"})
  • db.shops.ensureIndex({"address.zip":1})
  • db.shops.ensureIndex({"address.city":1})
  • db.shops.ensureIndex({"date":1})

Operations

  • Dump : mongodump --username admin --password iamagod --authenticationDatabase admin --db main --collection shops
  • Restore : mongorestore --username admin --password iamagod --db main --authenticationDatabase admin --collection shops dump/test/shops.bson

Install php api

  • Install autoconf [Mac OS]
    • take autoconf
    • curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz && tar -xzf autoconf.tar.gz && cd autoconf-2.69 && ./configure && make
    • sudo make install
    • export PHP_AUTOCONF=/usr/local/bin/autoconf
  • sudo pecl install mongo
  • sudo vi /etc/php.ini and add extension=mongo.so
  • Install composer :
    • curl -sS https://getcomposer.org/installer | php
    • mv composer.phar /usr/local/bin/composer
  • Install API deps : cd api && composer install

Map API

  • Demo account created on https://developer.here.com/myapps/app-details/5twHHror0c2KgeiMxSzJ#/
  • More tiles http://leaflet-extras.github.io/leaflet-providers/preview/index.html

DBViewer

  • Edit dbViewer/config.js
  • node dbViewer/app.js
  • http://localhost:8081

Miscs

  • //<?php $cursor = $shops->find()->sort(array("_id"=>-1))->limit($limit)->skip($skip);
  • console.log(leafletEvents.getAvailableMapEvents());
  • console.log(leafletEvents.getAvailableMarkerEvents());
  • http://l-lin.github.io/font-awesome-animation/
  • sudo mongod --fork --logpath /var/log/mongodb.log --dbpath $HOME/Projects/haveidols/testMongoDB/data --auth
  • mongo --host localhost --port 27017 --username admin --password iamagod admin --authenticationDatabase admin
  • mongodump --host localhost --port 27017 --username admin --password iamagod --authenticationDatabase admin --db main --collection shops