Skip to content

Instantly share code, notes, and snippets.

View chiehwen's full-sized avatar

Chuck Yang chiehwen

View GitHub Profile
@chiehwen
chiehwen / xhr-load-json.js
Created November 19, 2017 14:49 — forked from rjbultitude/xhr-load-json.js
A function that makes an XHR expecting and returning JSON. In CJS format
'use strict';
module.exports = function () {
return function(file, callback, errorCallback) {
var xhr = new XMLHttpRequest();
xhr.callback = callback;
if (xhr.overrideMimeType) {
xhr.overrideMimeType('application/json');
}
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 :
/*
Folder structure :
/frontend <-- AngularJS app
/dist <-- Production ready files
/assets
/css
/js
index.html
/src <-- Source files
# Post Install Script: delete OSX hidden Files
find ./ -name ._\* -print0 | xargs -0 rm -f
find ./ -name .DS_Store -print0 | xargs -0 rm -f
# Post Install Script: delete project keys
find ./ -name .bowerrc -print0 | xargs -0 rm -f
find ./ -name .gitignore -print0 | xargs -0 rm -f
find ./ -name *.command -print0 | xargs -0 rm -f

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
input {
file {
type => nginx_web
path => ["/var/log/nginx/*"]
exclude => ["*.gz"]
}
}
filter {
grok {