Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
getting things done 💪🏻

Ludovic Wyffels ludovicwyffels

🤠
getting things done 💪🏻
View GitHub Profile
View docker-nodeApp-secure-part2
FROM node:8
RUN groupadd -r nodejs && useradd -m -r -g -s /bin/bash nodejs nodejs
USER nodejs
WORKDIR /home/nodejs/app
COPY package.json .
RUN npm install --production
View docker-nodeApp-secure-part1
FROM node:8
RUN groupadd -r nodejs && useradd -m -r -g -s /bin/bash nodejs nodejs
USER nodejs
...
View docker-nodeApp-basic
FROM node:8
WORKDIR /home/nodejs/app
COPY . .
RUN npm install --production
CMD [“node”, “index.js”]
View loop-for-in-enumerable-false.js
let obj = {};
Object.defineProperty(obj, 'a', {
value: 1,
enumerable: false
});
Object.defineProperty(obj, 'b', {
value: 2,
enumerable: false
View loop-for-in.js
let obj = {
a: 1,
b: 2,
c: 3,
d: 9
};
console.log(obj.propertyIsEnumerable('a'));
for (let key in obj) {
View loop-for-of.js
const arr = [2,4,5,6,8,9];
for(let num of arr) {
console.log(num);
}
const str = 'JavaScript';
for(let letter of str) {
console.log(letter);