Skip to content

Instantly share code, notes, and snippets.

Peter Vu vietvu-nguyen

  • neukind
  • tokyo
Block or report user

Report or block vietvu-nguyen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vietvu-nguyen
vietvu-nguyen / 01-directory-structure.md
Created Jan 17, 2020 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.
View 01-directory-structure.md

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
View better-nodejs-require-paths.md

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@vietvu-nguyen
vietvu-nguyen / index.html
Created Feb 11, 2019
Simple CSS animation
View index.html
<div class="wrap">
<div class="container">
<h1>Rotate</h1>
<div class="box1 box"></div>
</div>
<div class="container">
<h1>Translate</h1>
<div class="boxes">
<div class="box2H box"></div>
<div class="box2 box"></div>
You can’t perform that action at this time.