Skip to content

Instantly share code, notes, and snippets.

View loic-moriame's full-sized avatar

Loïc Moriamé loic-moriame

View GitHub Profile
@loic-moriame
loic-moriame / keybase.md
Created June 6, 2019 08:27
Keybase proof

Keybase proof

I hereby claim:

  • I am loic-moriame on github.
  • I am loic_moriame (https://keybase.io/loic_moriame) on keybase.
  • I have a public key ASCmaACgfX1uCt_1c9bnJyeqS9rqCag2KoOgF0REeqy31wo

To claim this, I am signing this object:

@loic-moriame
loic-moriame / index.js
Created July 24, 2015 09:23
node.js + sequelize + sqlite
'use strict';
var Sequelize = require('sequelize');
var sequelize = new Sequelize('mainDB', null, null, {
dialect: "sqlite",
storage: './test.sqlite',
});
sequelize
@loic-moriame
loic-moriame / config_vm.sh
Created March 12, 2015 15:33
Export a CentOS Vagrant Box using VirtualBox
# from the VM to export
# Remove the udev persistent net rules file:
rm -f /etc/udev/rules.d/70-persistent-net.rules
# Clean history
rm .bash_history
history -c
# Shutdown the virtual machine:
@loic-moriame
loic-moriame / gist:2e6d98a6aa3a495089a9
Created July 18, 2014 12:58
ExpressJS + AngularJS : Quelle structure ?
Structure & besoins d'une application construite avec ExpressJS + AngularJS.
BESOINS
========
- avoir un frontend avec authentification obligatoire pour accéder à l'applicatif
> la première page sera celle de login
- la partie "admin" doit permettre de gérer les utilisateurs / permissions
USERS :
@loic-moriame
loic-moriame / array_isEqual.js
Created August 20, 2013 12:32
Add function "array.isEqualTo(arrayComparision)" to compare 2 one-dimensional's arrays
Array.prototype.isEqualTo = function(array) {
if(!array) {
return false;
}
if(!(array instanceof Array)) {
return false;
}
if(this.length != array.length) {
@loic-moriame
loic-moriame / array_unset.js
Created August 20, 2013 10:33
Add function "array.unset(value, [global])" to remove a value from a one-dimensional's array. Can remove the first occurence or all
Array.prototype.unset = function(value, global){
var index = this.indexOf(value),
global = global || false;
while(index > -1) {
this.splice(index, 1);
index = global ? this.indexOf(value) : -1;
}
}
@loic-moriame
loic-moriame / app.js
Last active December 21, 2015 07:58 — forked from dskanth/app.js
Update script to Express 3.3.x
var port = 3000,
express = require('express'),
io = require('socket.io').listen(app.listen(port));
// routing
app.get('/', function (req, res) {
res.sendfile(__dirname + '/chat.html');
});
// usernames which are currently connected to the chat