Skip to content

Instantly share code, notes, and snippets.

View thedamian's full-sized avatar

Damian Montero thedamian

View GitHub Profile
@thedamian
thedamian / gist:ecc57e6aefa0e9f46d746da27de2c91d
Created October 25, 2022 02:50
TesnorFlow.js Basic Example
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.11.2"></script>
</head>
<body>
<div id="output_field"></div>
</body>
<script>
async function learnLinear() {
const model = tf.sequential();
@thedamian
thedamian / companies.js
Last active May 5, 2019 18:58
Top Companies worldwide by Marketcap
let companies = [
'AAPL',
'MSFT',
'AMZN',
'GOOGL',
'FB',
'BRK.A',
'BABA'
//'SEHK: 700' // wechat's tencent
'JPM',
@thedamian
thedamian / server.js
Created May 5, 2019 17:03
basic node express app
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");
});
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 / 0_reuse_code.js
Created April 27, 2017 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console