This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas as pd | |
from sqlalchemy import create_engine | |
from datetime import datetime, timezone, timedelta | |
## Load Data from API to Dataframe | |
url = "https://api.openweathermap.org/data/2.5/weather?appid=<API KEY>&q=Bangkok&units=metric" | |
response = requests.get(url) | |
data = response.json() | |
df = pd.json_normalize(data) | |
# ... continue clean the dataframe [df] if needed ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var viewer = new Cesium.Viewer('cesiumContainer', { | |
imageryProvider: new Cesium.MapboxStyleImageryProvider({ | |
styleId: '<Style ID (e.g. light-v10, streets-v11, etc.)>', | |
accessToken: '<Your Mapbox Access Token (pk....)>' | |
}), | |
//other viewer option | |
//see full documentation: https://cesium.com/docs/cesiumjs-ref-doc/Viewer.html | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pycountry | |
import pandas as pd | |
df = pd.read_csv('https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/12-18-2020.csv') | |
def findCountryAlpha2 (country_name): | |
try: | |
return pycountry.countries.get(name=country_name).alpha_2 | |
except: | |
return ("not founded!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mammoth | |
with open("sample.docx", "rb") as docx_file: | |
result = mammoth.convert_to_markdown(docx_file) | |
with open("sample.md", "w") as markdown_file: | |
markdown_file.write(result.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mammoth | |
with open("sample.docx", "rb") as docx_file: | |
result = mammoth.convert_to_html(docx_file) | |
with open("sample.html", "w") as html_file: | |
html_file.write(result.value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cesium.com/downloads/cesiumjs/releases/1.80/Build/Cesium/Cesium.js"></script> | |
<link href="https://cesium.com/downloads/cesiumjs/releases/1.80/Build/Cesium/Widgets/widgets.css" rel="stylesheet"> | |
</head> | |
<body> | |
<div id="cesiumContainer" style="width: 100%; height:100%"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adding terrain | |
var terrainProvider = new Cesium.createWorldTerrain({ | |
requestWaterMask : true, // required for water effects | |
requestVertexNormals : true // required for terrain lighting | |
}); | |
viewer.terrainProvider = terrainProvider; | |
viewer.scene.globe.enableLighting = true; // set lighting to true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var viewer = new Cesium.Viewer('cesiumContainer'); | |
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ | |
url : '<Link to Tileset.json>' | |
})); | |
tileset.readyPromise.then(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const http = require('http') | |
const https = require('https') | |
const express = require('express') | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send('Hello World!'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
app.use(express.static(__dirname, { dotfiles: 'allow' } )); | |
app.listen(80, () => { | |
console.log('HTTP server running [port - 80]'); | |
}); |