Skip to content

Instantly share code, notes, and snippets.

View hhkaos's full-sized avatar
🏠
Working from home

Raul Jimenez Ortega hhkaos

🏠
Working from home
View GitHub Profile
@hhkaos
hhkaos / script.md
Last active May 1, 2024 17:28
From Zero to Newbie with ArcGIS API for JS and TypeScript

From zero to newbie with ArcGIS API for JS and TS.

Hello TypeScript demo

Initialize a typescript project:

npm init -y
npm i typescript --save-dev
@hhkaos
hhkaos / sample.json
Created April 2, 2024 09:09
gmaps-locations-history.json
{
"timelineObjects": [
{
"placeVisit": {
"location": {
"latitudeE7": 404763025,
"longitudeE7": -36856992,
"placeId": "ChIJPdB-HGspQg0RkIBhPiXUAEM",
"address": "P.º de la Castellana, 280, Chamartín, 28046 Madrid, España",
"semanticType": "TYPE_SEARCHED_ADDRESS",
@hhkaos
hhkaos / instructions.md
Last active April 1, 2024 15:36
Export your Google Location History to CSV

Install: google_takeout_parser

Run: google_takeout_parser parse -f Location Takeout

Type this to create a CSV file:

def write_to_csv(file_path, data_instances):
    import csv
@hhkaos
hhkaos / zapier_get_thumbnail_image_from_html.js
Last active February 5, 2024 19:21
This script can be executed using the "Code by Zapier" app to get an image from a page - https://zapier.com/zapbook/code/
/*
You need to set an inputData param called 'link'
with the URL field you want to parse.
More info: https://zapier.com/help/code/#data-variables
*/
fetch(inputData.link)
.then(function(res) {
return res.text();
})
.then(function(body) {
@hhkaos
hhkaos / readme.md
Last active July 25, 2023 22:30
OGC certified products
(base) jovyan@37266f7fb205:~$ conda install python=3.9  arcgis_learn -c esri/label/beta -c esri-build/label/forge -c esri-build -c esri

Collecting package metadata (current_repodata.json): failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/conda/gateways/repodata/__init__.py", line 187, in conda_http_errors
        yield
@hhkaos
hhkaos / arcgis-maps-sdk-for-js-repos.md
Created July 5, 2023 13:59
Save all repositories URLs to a local file
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:esri-javascript-api | jq '.items[] | {url:.url}' > repos.js

curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:esri-js | jq '.items[] | {url:.url}' >> repos.js

curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:arcgis-api | jq '.items[] | {url:.url}' >> repos.js
import express from 'express';
const app = express()
const port = 3000
app.get('/', async (req, res) => {
res.redirect('https://www.arcgis.com/sharing/rest/oauth2/authorize/?client_id=XXXXX&redirect_uri=https://hhkaos.github.io/arcgis-oauth-callback/&response_type=code&code_challenge=qaXuju2sX8lKLvErIKHfdrg0h7DLvSeLuErfsfMJFj4&code_challenge_method=S256')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
@hhkaos
hhkaos / demo.js
Created February 11, 2023 06:47 — forked from aslushnikov/demo.js
service worker network throttling with pptr
const puppeteer = require('puppeteer');
(async() => {
// Step 1: launch browser and open a new page.
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Step 2: PPTR.DEV has a service worker \m/
// Go there and wait for SW to register.
await page.goto('https://pptr.dev/');
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>OL: Filter feature layer</title>
<style>
html,
body,