Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Programming. Speaking, Playing with the little one!

Damian Montero thedamian

💭
Programming. Speaking, Playing with the little one!
View GitHub Profile
@thedamian
thedamian / 0_reuse_code.js
Created Apr 27, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:14213922b9127c8442b5b53f5345b647
const fs = require('fs');
let population = JSON.parse(fs.readFileSync('population.json','utf8'));
population = population.filter(c => c.Year == "2016");
population = population.map(c=> {return {code3:c['Country Code'],population:c.Value}});
population = population.filter(c => c != null);
let country3to2 = JSON.parse(fs.readFileSync('3to2countrycode.json','utf8'));
population = population.filter(c => c != null);
population = population.map(c=> {
@thedamian
thedamian / server.js
Created May 5, 2019
basic node express app
View server.js
const http = require("http");
const express = require("express");
const app = express();
app.set('view engine', 'ejs');
const port = 5000; ;
app.get("/",(req,res)=> {
res.end("Hello world");
});
@thedamian
thedamian / companies.js
Last active May 5, 2019
Top Companies worldwide by Marketcap
View companies.js
let companies = [
'AAPL',
'MSFT',
'AMZN',
'GOOGL',
'FB',
'BRK.A',
'BABA'
//'SEHK: 700' // wechat's tencent
'JPM',