Skip to content

Instantly share code, notes, and snippets.

View aurelienpierre's full-sized avatar
🚣‍♂️
I may be slow to respond.

Aurélien PIERRE aurelienpierre

🚣‍♂️
I may be slow to respond.
View GitHub Profile
@aurelienpierre
aurelienpierre / lagrange.py
Last active December 8, 2022 10:44
[Python] Computes the symbolic expression of the Lagrange interpolation polynomial and evaluates the function if needed
from sympy import *
from sympy.matrices import *
import numpy
import pylab
import warnings
def Lagrange_interpolation(points, variable=None):
"""
Compute the Lagrange interpolation polynomial.
#!/usr/bin/env python3
# © Aurélien PIERRE - 2022
# Licensed under the terms of the Do What the Fuck You Want to Public License (WTFPL)
import os
import re
"""
Step 1: gather GUI labels and module names from source code,
@aurelienpierre
aurelienpierre / pandas-checks.py
Last active March 16, 2022 10:50
Perform usual types and values checks on columns of a pandas.DataFrame
# Create Dataframe with fake data
df = pd.util.testing.makeMissingDataframe()
df['index1'] = df.index # create a text column by replicating index
df['A'] = 0 # create a zero column
# Helper function
def check_df_sanity(df, verbose=False):
"""Perform usual types and values checks on columns of a pandas.DataFrame"""
for col in df:
@aurelienpierre
aurelienpierre / start Da Vinci Resolve on 4K HiDPI screen with Nvidia Prime Xorg on Linux (Fedora 32)
Last active July 9, 2020 14:54
Solve the DPI scaling issue and start the application on discrete GPU altogether. Works the same with any Qt app needing GPU acceleration without having internal DPI scaling.
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia QT_DEVICE_PIXEL_RATIO=2 QT_AUTO_SCREEN_SCALE_FACTOR=true /opt/resolve/bin/resolve
This file has been truncated, but you can view the full file.
____________________________________________
Start of NVIDIA bug report log file. Please include this file, along
with a detailed description of your problem, when reporting a graphics
driver bug via the NVIDIA Linux forum (see devtalk.nvidia.com)
or by sending email to 'linux-bugs@nvidia.com'.
nvidia-bug-report.sh Version: 23400452
Date: mardi 10 +avril 2018, +14:03:26 +(UTC-0400)
@aurelienpierre
aurelienpierre / Winetricks
Last active May 30, 2017 23:02
Creates a complete fake Windows 7 installation within a Wine Prefix in one command
#!/bin/bash
winetricks ie8 wmp10 allcodecs d3dx11_43 dotnet40 vc2005 vc2008 dsound ogg allfonts hosts ddr=opengl fontsmooth=rgb videomemorysize=2048 win7 glsl=enabled ao=enabled rtlm=auto psm=enabled mwo=force fontsmooth=rgb vsm=hardware
@aurelienpierre
aurelienpierre / darktable.css
Created December 1, 2016 18:33
Darktable 50% grey stylesheet
@define-color bg_color #7C7C7C;
@define-color plugin_bg_color #333;
@define-color fg_color #eee;
@define-color base_color #444;
@define-color text_color #eee;
@define-color selected_bg_color #666;
@define-color selected_fg_color #eee;
@define-color tooltip_bg_color #BEBEBE;
@define-color tooltip_fg_color #111;
@define-color really_dark_bg_color #595959;
@aurelienpierre
aurelienpierre / Wacom Intuos Configuration
Last active May 15, 2016 12:41
Manualy assign buttons configuration to Wacom Intuos Tablet. Save this into /usr/bin/tablette.sh
#!/bin/bash
export LANG="fr_FR.UTF-8"
## Pad
PAD="Wacom Intuos PT M Finger pad"
xsetwacom set "$PAD" Button 3 "key Ctrl Super T" #up left button ## configured as touch switch - Ctrl Super T is set to call Touch switch script in the OS
xsetwacom set "$PAD" Button 1 "key super" #bottom left button ## configured as "Menu"
xsetwacom set "$PAD" Button 9 "key Ctrl Z" #top right button ## configured as "Undo"
xsetwacom set "$PAD" Button 8 "key Ctrl Y" #bottom right button ## configured as "Redo"
@aurelienpierre
aurelienpierre / Image optimize
Created January 19, 2014 08:42
A simple script which applies non-destructive optimization algorithms on png and jpg files in order to adjust size vs quality. It proceeds every file in a directory. Linux only. It can easily be added in Nautilus through Nautilus-Actions.
#!/bin/bash
# Required commands :
# - optipng
# - jpegoptim
# optipng (non destructive)
optipng *.png
optipng *.PNG
@aurelienpierre
aurelienpierre / Wacom Intuos Tablet udev configuration
Created January 26, 2014 23:24
Run the configuration script '/usr/bin/tablette.sh' when a Wacom Intuos is plugged. You have to save this command into /etc/udev/rules.d/90-wacom.rules
ACTION=="add", ATTRS{idVendor}=="056a", ATTRS{idProduct}=="0303", RUN+="/usr/bin/tablette.sh"