Skip to content

Instantly share code, notes, and snippets.

View Rub21's full-sized avatar
🐕

Ruben L. Mendoza Rub21

🐕
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from requests_oauthlib import OAuth2Session
client_id = r'CV5dBzhOwDZkZeCj4xyosVOIJAkTuCZm-HlCK0P2Sfw'
client_secret = r'l3kMZgDojx8Kylh1_L0Eh9WD7KFORM4UEKZku66A7GY'
redirect_uri = 'http://127.0.0.1:8111/oauth_authorization'
scope = ["read_prefs"]
oauth = OAuth2Session(client_id=client_id, redirect_uri=redirect_uri, scope=scope)
authorization_url, state = oauth.authorization_url('https://www.openstreetmap.org/oauth2/authorize')
from requests_oauthlib import OAuth2Session
client_id = r'n6BbW1HCLeK5ImKkRsrVjYkn2sdaroPIGLASpdovvXY'
client_secret = r'Bx7fPt8jPPi0jN9sv6GBMULlvo_5crNUGul_XxgZ5I4'
redirect_uri = 'http://127.0.0.1:8111/oauth_authorization'
scope = ["read_prefs"]
oauth = OAuth2Session(client_id=client_id, redirect_uri=redirect_uri, scope=scope)
authorization_url, state = oauth.authorization_url('https://staging.openhistoricalmap.org/oauth2/authorize')
print(f"Visit {authorization_url} and paste the code in")
code = input()
token = oauth.fetch_token('https://staging.openhistoricalmap.org/oauth2/token',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
id,date,currency,eur_rate,uah_rate,usd_rate,countries
20220101eur,2022-01-01,EUR,1.0,31.015503,1.136796,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA, LTU, LUX, MLT, MCO, MNE, NLD, PRT, SMR, SVK, SVN, ESP"
20220102eur,2022-01-02,EUR,1.0,31.027851,1.138068,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA, LTU, LUX, MLT, MCO, MNE, NLD, PRT, SMR, SVK, SVN, ESP"
20220103eur,2022-01-03,EUR,1.0,30.809453,1.129396,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA, LTU, LUX, MLT, MCO, MNE, NLD, PRT, SMR, SVK, SVN, ESP"
20220104eur,2022-01-04,EUR,1.0,30.771885,1.128253,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA, LTU, LUX, MLT, MCO, MNE, NLD, PRT, SMR, SVK, SVN, ESP"
20220105eur,2022-01-05,EUR,1.0,31.064821,1.130775,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA, LTU, LUX, MLT, MCO, MNE, NLD, PRT, SMR, SVK, SVN, ESP"
20220106eur,2022-01-06,EUR,1.0,31.046437,1.130029,"AND, AUT, BEL, CYP, CZE, EST, FIN, FRA, DEU, GRC, IRL, ITA, LVA,
Sending build context to Docker daemon 853B
Step 1/11 : FROM python:3.7-alpine
---> 04ffff590161
Step 2/11 : RUN apk update && apk add git
---> Running in 511c8c2a2c18
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
v3.16.1-93-g26e44ca6a3 [https://dl-cdn.alpinelinux.org/alpine/v3.16/main]
v3.16.1-93-g26e44ca6a3 [https://dl-cdn.alpinelinux.org/alpine/v3.16/community]
OK: 17034 distinct packages available
@Rub21
Rub21 / web.log
Created August 3, 2022 01:52
ohm web correct logs
aiting to start rails ports server...
Waiting to start rails ports server...
/var/www/config/initializers/config.rb:19: warning: already initialized constant ALLOWED_STATUS
/var/www/config/initializers/config.rb:19: warning: previous definition of ALLOWED_STATUS was here
Waiting to start rails ports server...
autoprefixer: /var/www/app/assets/stylesheets/screen-rtl.css:1:58203: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
autoprefixer: /var/www/app/assets/stylesheets/screen-ltr.css:4147:3: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
Waiting to start rails ports server...
autoprefixer: /var/www/app/assets/stylesheets/leaflet-all.scss:655:3: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
autoprefixer: /var/www/app/assets/stylesheets/embed.scss:655:3: Replace color-adjust to print-color-adjust. The color-adjust shorthand is currently deprecated.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Rub21
Rub21 / index.html
Created March 3, 2022 22:53
mexico boundary import
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Swipe between maps</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<link href="https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v2.7.0/mapbox-gl.js"></script>
<style>
body { margin: 0; padding: 0; }
[{"parameter":"co","location":"Usaquen","city":"Bogota","country":"Colombia","value":0.719287,"unit":"ppm","date":{"utc":"2021-11-18T14:09:00Z","local":"2021-11-18T09:09:00-05:00"},"sourceName":"Usaquen","sourceType":"government","mobile":false,"coordinates":{"latitude":4.70939,"longitude":-74.03199},"attribution":{"name":"Secretaria Distrital de Ambiente","url":"http://www.ambientebogota.gov.co/"},"averagingPeriod":{"value":1,"unit":"hours"}},{"parameter":"pm25","location":"Usaquen","city":"Bogota","country":"Colombia","value":27.0,"unit":"µg/m3","date":{"utc":"2021-11-18T14:09:00Z","local":"2021-11-18T09:09:00-05:00"},"sourceName":"Usaquen","sourceType":"government","mobile":false,"coordinates":{"latitude":4.70939,"longitude":-74.03199},"attribution":{"name":"Secretaria Distrital de Ambiente","url":"http://www.ambientebogota.gov.co/"},"averagingPeriod":{"value":1,"unit":"hours"}},{"parameter":"pm10","location":"Usaquen","city":"Bogota","country":"Colombia","value":52.64,"unit":"µg/m3","date":{"utc":"2021-11