Skip to content

Instantly share code, notes, and snippets.

View epifanio's full-sized avatar

Massimo Di Stefano epifanio

View GitHub Profile
@CodeShakingSheep
CodeShakingSheep / nextcloud-deck-export-import.py
Last active May 14, 2024 10:55 — forked from svbergerem/nextcloud-deck-export-import.py
Nextcloud Deck Export/Import (Note that all comments will be created from the user account specified in the first lines of the script)
# You need to have the 'requests' module installed, see here: https://pypi.org/project/requests/
import requests
# Note regarding 2FA
# You can either disable 'Enforce 2FA' setting and disable '2FA'. Then you can just use your regular user password.
# Or you can just use an app password, e.g. named 'migration' which you can create in 'Personal settings' --> 'Security'. After successful migration you can delete the app password.
urlFrom = 'https://nextcloud.domainfrom.tld'
authFrom = ('username', 'user password or app password')
urlTo = 'https://nextcloud.domainto.tld'
@aborruso
aborruso / README.md
Last active February 26, 2021 16:26

Avere risposta "content-type: text/csv" da CSV pubblicati su GitHub

Se puntiamo a un CSV pubblicato su GitHub, il server risponde con

HTTP/2 302
date: Tue, 19 Jan 2021 07:54:53 GMT
content-type: text/html; charset=utf-8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lambdamusic
lambdamusic / python_request_create_gist.py
Last active April 11, 2021 20:19 — forked from joshisumit/python_request_create_gist.py
Create GIST from your python code with python requests module and OAuth token.
'''
HTTP Reuests has following parameters:
1)Request URL
2)Header Fields
3)Parameter
4)Request body
PREREQUISITE
* head over to https://github.com/settings/tokens and generate a new token with 'gists' permissions
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
import numpy as np
user = sys.argv[1]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
gdal_translate -of GMT grassdata/nc_basic_spm_grass7/PERMANENT/cellhd/elevation elevation.gmt
gdalwarp -overwrite elevation.gmt out_elevation.gmt -t_srs EPSG:4326
gmt grdgradient out_elevation.gmt -Ne0.8 -A100 -fg -Gus_i.nc
gmt makecpt -Chaxby -T50/160/10 -Z > topo.cpt
gmt grdimage out_elevation.gmt -JM6i -P -Ba -Ctopo.cpt -V -K -Ius_i.nc >> GMT_tut_12.ps
gmt grdcontour out_elevation.gmt -JM6i -O -BWSne -C20 -A20 >> GMT_tut_12.ps
gmt psscale -DjTC+w5i/0.25i+h+o0/-1i -Rout_elevation.gmt -JM6i -Ctopo.cpt -B+tcontinuous -I0.5 -O -Ba1000:Elevation:/:m: >> GMT_tut_12.ps