Skip to content

Instantly share code, notes, and snippets.

View francbartoli's full-sized avatar

Francesco Bartoli francbartoli

View GitHub Profile
@mvaled
mvaled / gist:720753
Created November 29, 2010 22:22
Generates Wordpress.com's HTML from reStructuredText
#! /usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Generate an HTML Snippet for WordPress Blogs from reStructuredText.
#
# This is a modification of the standard HTML writer that leaves out
# the header, the body tag, and several CSS classes that have no use
# in wordpress. What is left is an incomplete HTML document suitable
# for pasting into the WordPress online editor.
#
@niallo
niallo / ubuntu-lucid-python-2.7
Created March 8, 2012 22:59
Puppet module to install & set default Python to 2.7 on Ubuntu 10.04 LTS / Lucid
class python27 {
Package { ensure => "installed" }
$apt-base = "/etc/apt/sources.list.d/fkrull-"
Exec { require => Package["python-software-properties"] }
exec { "python-repo" :
command => "/usr/bin/add-apt-repository ppa:fkrull/deadsnakes",
creates => "${apt-base}deadsnakes-lucid.list",
@glenrobertson
glenrobertson / TileLayer.GeoJSON.js
Created September 15, 2012 00:02
GeoJSON Leaflet Tile Layer
/*
GeoJSON layer with mouse hover events to properties for each feature
Requires JQuery to handle the AJAX requests
Currently only supports FeatureCollections
Features must have ID's, so they can be deduplicated across tiles (not rendered twice).
*/
/*
Control that shows HTML content for a point on hover
*/
@isao
isao / funcsimple.js
Created December 4, 2012 00:08
minimal cli func test with shelljs
#!/usr/bin/env node
var assert = require('assert'),
shell = require('shelljs'),
path = require('path'),
BASEDIR = path.resolve(__dirname, '../') + '/',
NEWSAPP = BASEDIR + 'examples/newsboxes/';
@francbartoli
francbartoli / nc_to_gtiff.py
Created November 24, 2017 22:55 — forked from arbennett/nc_to_gtiff.py
Workflow for uploading data from netcdf to google earth engine
#!/usr/bin/env python2
"""
Script that allows for conversion of a netcdf file to
a stack of geotiff files with each raster being a time
slice from the input file.
Base implementation taken from:
https://www.linkedin.com/pulse/convert-netcdf4-file-geotiff-using-python-chonghua-yin
Usage:
@t-book
t-book / Apache:GeoNode SSL-TLS LE Authority
Last active May 7, 2019 19:21
Add let´s enrypt to geonode
# - Close port 8080 for inbound networking
# - Edit your local_settings to use proxy /geonode (and not port 8080)
# - Add following to local_settings: AVATAR_GRAVATAR_SSL = True
# - make sure mod_ssl is active: $ a2enmod ssl
# add let´s encrypt repository
$ sudo add-apt-repository ppa:certbot/certbot
$ sudo apt-get update
# install certbot
@tomkralidis
tomkralidis / README.md
Last active August 3, 2020 00:48
Metadata records TinyDB experiment

Overview

This gist demonstrates creating a document store of OGC API - Records records using TinyDB as a backend.

Steps

pip3 install lxml owslib tinydb
python3 create-records-tinydb.py msc-wis-dcpc-discovery-metadata.xml
@max-mapper
max-mapper / readme.md
Last active January 28, 2024 18:11
How-to: Write a node module with voxel.js

Writing node modules with voxel.js

This is a short guide that will teach you the workflows that have been figured out by the voxel.js community for writing node modules + sharing them on NPM and Github. It is assumed that you have a basic understanding of JavaScript, github and the command line (if not you can check out an introduction to git and the command line or learn JS basics from JavaScript for Cats)

The voxel-tower repository on github contains all the example code from this guide.

Table of contents

@TylerWanner
TylerWanner / README.md
Last active March 4, 2024 20:54
Terraform Deploy Prefect Server to GCP

Provisioning Prefect Server on GCP using Terraform

Requirements: Terraform, GCP credentials with permission to create a project Tested with: Terraform v0.12.23, google cloud provider v3.26

To run:

You can use an environment variable to set which service account key to use during provisioning export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key The service account you use must belong to a GCP project that has the necessary APIs enabled (such as billing and resource manager)--if it does not, you may have to enable these APIs manually along the way in those projects In this directory, run terraform init then terraform apply -- you will need to provide a billing_id and organization_id for your GCP project

Once successful, be sure to add the following to your ~/.prefect/config.toml

@dedsm
dedsm / timescale--db--backend--base.py
Last active March 6, 2024 21:20
WeRiot Django Timescale integration
import logging
from django.contrib.gis.db.backends.postgis.base import \
DatabaseWrapper as PostgisDBWrapper
from django.db import ProgrammingError
from .schema import TimescaleSchemaEditor
logger = logging.getLogger(__name__)