Skip to content

Instantly share code, notes, and snippets.

@modelmat
modelmat / _classes_output.json
Last active April 13, 2023 08:06
A simple API for My Study Life application
{
"academic_years":[
{
"created_at":"2018-08-11T11:35:29",
"deleted_at":null,
"end_date":"2018-12-19",
"guid":"2adeab27-b77d-40e8-b5c6-48ff699833ef",
"holidays":[
],
@modelmat
modelmat / income_distribution.py
Last active February 27, 2022 22:42
Universal Basic Income Comparison Script for USA/AUS
# TODO: do the conversion from the data directly
# Data Format is a list of [weekly income, percentage of population from 0-100]
wealth_distributions = {
# Graph 1 from https://www.abs.gov.au/statistics/economy/finance/government-benefits-taxes-and-household-income-australia/latest-release#income-redistribution-and-inequality
"AUS": [[50.0, 1.9], [100.0, 1.8], [150.0, 2.2], [200.0, 2.1], [250.0, 2.1], [300.0, 1.8], [350.0, 2.1], [400.0, 2.3], [450.0, 2.3], [500.0, 2.9], [550.0, 2.2], [600.0, 2.6], [650.0, 2.4], [700.0, 3.3], [750.0, 2.3], [800.0, 2.4], [850.0, 2.6], [900.0, 2.7], [950.0, 2.6], [1000.0, 2.5], [1050.0, 2.8], [1100.0, 2.3], [1150.0, 2.3], [1200.0, 2.2], [1250.0, 2.1], [1300.0, 2.0], [1350.0, 1.7], [1400.0, 2.5], [1450.0, 2.0], [1500.0, 1.6], [1550.0, 1.6], [1600.0, 1.5], [1650.0, 1.4], [1700.0, 1.2], [1750.0, 1.3], [1800.0, 1.2], [1850.0, 1.1], [1900.0, 0.9], [1950.0, 0.9], [2000.0, 1.2], [2050.0, 0.8], [2100.0, 0.9], [2150.0, 0.9], [2200.0, 0.8], [2250.0, 0.8], [2300.0, 0.8], [2350.0,
@modelmat
modelmat / build_debug_packages.py
Last active January 6, 2021 04:07
Build debug packages for Arch Linux from a list of files
"""Build debug packages for Arch Linux from a list of files
Install:
In `/etc/makepkg.conf` disabling stripping binaries and enable the
creation of `-debug` packages.
$ pip install pyalpm
Usage:
Create a file named "debug_symbol_files.txt"
@modelmat
modelmat / sensor-power.py
Created July 18, 2020 02:14
Get real-time power consumption for AMD CPU
# requires pysensor module from pypi
import sensors
def main():
voltages = {}
amperages = {}
sensors.init()
cpu = next(sensors.iter_detected_chips("k10temp-pci-00c3"))
@modelmat
modelmat / script.cs
Created October 17, 2019 07:35
Ravenfield Landable Planes Script. Tested through to EA12, may work in newer versions.
/*
1. Create a bool `down` in the Plane script class.
2. Insert the below code in the methods in the Plane class.
*/
void Update() {
// Insert at the end
if (Input.GetKeyDown(KeyCode.Z) && this.seats[0].IsOccupied() && !this.seats[0].occupant.aiControlled)
{
if (this.down) {