Skip to content

Instantly share code, notes, and snippets.

View ThomasG77's full-sized avatar

Thomas Gratier ThomasG77

View GitHub Profile
@mdouchin
mdouchin / AuditQGISProjects.py
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. *
* *
***************************************************************************
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active June 26, 2025 22:23
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@nurdabolatov
nurdabolatov / parallel-processing-large-file-in-python.py
Created May 8, 2021 20:30
Parallel processing large file in Python
# Source: https://nurdabolatov.com/parallel-processing-large-file-in-python
import multiprocessing as mp
import time
import os
def process_line(line):
# Count frequency for every character
counter = {}
@MattHodge
MattHodge / Save-Download.ps1
Created April 11, 2021 13:03
Save-Download.ps1
function Save-Download {
<#
.SYNOPSIS
Given a the result of WebResponseObject, will download the file to disk without having to specify a name.
.DESCRIPTION
Given a the result of WebResponseObject, will download the file to disk without having to specify a name.
.PARAMETER WebResponse
A WebResponseObject from running an Invoke-WebRequest on a file to download
.EXAMPLE
# Download Microsoft Edge
@s-m-e
s-m-e / mptest.py
Last active August 22, 2021 09:41
multiprocessing pool test, process-based and thread-based
# -*- coding: utf-8 -*-
# QGIS 3.x / Python 3.x
from math import sqrt, ceil
from multiprocessing import Pool, Process, Queue
from multiprocessing.pool import ThreadPool
WORKERS = 2
def worker_task(number):
@bmegli
bmegli / CMake_3_20_Ubuntu_18_04.md
Last active June 11, 2025 01:16
CMake 3.20 in Ubuntu 18.04 (reversible way)

Motivatation

  • modern CMake is required for building a lot of new software
  • CMake is dependency for many packages (e.g. ROS related)
  • we don't want to remove CMake (which would remove packages that depend on it)
  • we want safe procedure to update CMake that can be reversed easily

Current version in OS

Check current version

@sindresorhus
sindresorhus / esm-package.md
Last active July 6, 2025 04:40
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@migurski
migurski / OSMF-2021-Survey.qgz
Last active February 27, 2021 00:03
OSMF 2021 Survey Regions
@malchata
malchata / react-bias.md
Last active May 29, 2021 14:23
React Bias

React Bias

It may seem like a bold suggestion that we as web developers can choose the wrong tools for the job because we tend to be swayed by appeals to popularity or authority, but simple statistics imply just that. For example, React (https://reactjs.org/) is a JavaScript framework that emphasizes componentization and simplified state management. It enjoys strong advocacy from a vocal and dedicated userbase within the developer community.

Despite React’s apparent popularity, however, The HTTP Archive observed in 2020 that React only accounted for 4% of all libraries in use across the 7.56 million origins it analyzed (https://almanac.httparchive.org/en/2020/javascript#libraries).

For context, The State of JS 2020 Survey (https://2020.stateofjs.com/en-US/), which surveyed roughly 23,765 respondents, offers the following statistics:

  • 70.8% of respondents identified as white.
  • 91.1% identified as male, whereas 5.8% identified as female and 0.9% identified as non-binary/third gender.
@zit0un
zit0un / GeoJSON-OAS3.yaml
Last active June 27, 2025 13:59
OpenAPI (OAS3/Swagger) definition for GeoJSON objects
openapi: 3.0.0
info:
version: 1.0.1
title: GeoJSON format
description: >
This document defines the GeoJSON format as an OpenAPI.
It contains the definitions for 'Feature' object and 'FeatureCollection'
objects, as well as the definitions for all 'Geometry' objects.
It conforms with the 'RFC-7946' standard from IETF (August 2016 version)