Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
rastandy / solutions-json.php
Last active January 24, 2024 17:49
A Wordpress page template for obtaining a GeoJSON file from a list of posts with custom fields
Template Name: Solutions JSON
header( 'Content-Type: application/geo+json' . '; charset=' . get_option( 'blog_charset' ), true );
$more = 1;
echo '{"type": "FeatureCollection", "features": [';
ThomasG77 / .eslintrc.json
Last active April 18, 2022 23:24
Play with gdal.vectorTranslate in Node.js
"env": {
"node": true,
"es2021": true
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
mmazzarolo / runtime-globals-checker.js
Last active June 8, 2023 14:27
Find what JavaScript variables are leaking into the global `window` object at runtime (see:
* RuntimeGlobalsChecker
* You can use this utility to quickly check what variables have been added (or
* leaked) to the global window object at runtime (by JavaScript code).
* By running this code, the globals checker itself is attached as a singleton
* to the window object as "__runtimeGlobalsChecker__".
* You can check the runtime globals programmatically at any time by invoking
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()".
DavidWells / javascript-proxy-as-rest-client.js
Last active May 12, 2024 14:24
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via
// also see
// also see
// also see
// and
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
import re
import csv
import ssl
import urllib.request
ssl._create_default_https_context = ssl._create_unverified_context
baseUrl = ''
url_page = baseUrl + 'documentation/services'
davidbgk / .zshrc
Created December 15, 2021 15:09
Example of Python aliases + reimplementation of `cd` to auto de/activate the current virtualenv
# aliases
alias -g ll='ls -al'
alias -g subl='open -a "Sublime Text"'
alias server='python3 -m http.server 8000 --bind'
alias rmvenv='deactivate && rm -rf venv/'
alias venv='python3 -m venv venv'
alias activate='source venv/bin/activate'
alias pipupgrade='python3 -m pip install --upgrade pip'
alias requirements='python3 -m pip install -r requirements.txt'
yokawasa /
Last active June 12, 2024 14:43
ghcr (GitHub Container Registry)

ghcr (GitHub Container Registry) quickstart


To push container images to ghcr, you need peronal access token (PAT) - see how to create PAT

  1. Get PAT (personal access token)

Personal Settings > Developer settings > Personal access tokens

mdouchin /
Last active October 6, 2021 08:34
Audit the QGIS projects found in a directory and it sub-directories, and export a CSV file containing the fetched information
# -*- coding: utf-8 -*-
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *