Skip to content

Instantly share code, notes, and snippets.

@ghecho
ghecho / js_linux.py
Created August 14, 2018 01:19 — forked from rdb/js_linux.py
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://www.panda3d.org/forums/viewtopic.php?f=8&t=16767
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')
@ghecho
ghecho / scince_2020.sh
Created October 4, 2021 15:53 — forked from diegovalle/scince_2020.sh
Script to download shapefiles from 2020 Mexican census (including demographic data)
#!/usr/bin/env bash
# Author: Diego Valle-Jones
# Web: http://www.diegovalle.net
# Script to download shapefiles from 2020 Mexican census (including demographic data)
# tested on ubuntu 20.04
# Exit on error, undefined and prevent pipeline errors
set -euo pipefail
IFS=$'\n\t'
# The directory from which the script is running