Skip to content

Instantly share code, notes, and snippets.

View mrjxtr's full-sized avatar
🙏
Hard work... God first

Jester Lumacad mrjxtr

🙏
Hard work... God first
View GitHub Profile
@mrjxtr
mrjxtr / archsetup.md
Last active May 5, 2025 12:21
things to do after arch install

Create an empty volume on an existing disk or a separate disk. Create a bootable usb for installing arch Install arch using archinstall script

Things to do after arch install

update everything

sudo pacman -Syu

If boot is too long because of dev-tpmrm0

@mrjxtr
mrjxtr / Data Science.code-snippets
Last active November 7, 2024 15:55
VS CODE Data Science code-snippets
{
// Misc
"Create code block header": {
"prefix": "#",
"scope":"python",
"body": [
"#$1 ------------------------------------------------------",
"#$1 $2",
"#$1 ------------------------------------------------------"
],
@mrjxtr
mrjxtr / plots_cfg.py
Created October 12, 2024 11:21
Module for configuring plot aesthetics using Matplotlib and Seaborn.
"""
Module for configuring plot aesthetics using Matplotlib and Seaborn.
This module provides functions to set a custom color palette and apply
consistent theming across plots created with Matplotlib and Seaborn.
"""
import matplotlib as mpl
import seaborn as sns
from cycler import cycler
@mrjxtr
mrjxtr / custom-settings.css
Last active October 16, 2024 00:17
Custom settings for CSS and JS loader extensions
/** Cursor Custom Settings **/
/** Removing buttons on the start screen **/
.cursor-button.cursor-button-primary.cursor-button-primary-clickable {
display: none !important;
}
.cursor-button.cursor-button-secondary.cursor-button-secondary-clickable {
display: none !important;
}
@mrjxtr
mrjxtr / keybindings.json
Last active November 13, 2024 02:27
VSCode Keybindings
// Place your key bindings in this file to override the defaults
[
// Vim Navigation keybindings
{
"key": "ctrl-h",
"command": "workbench.action.navigateLeft"
},
{
"key": "ctrl-l",
"command": "workbench.action.navigateRight",
@mrjxtr
mrjxtr / settings.json
Last active November 13, 2024 02:27
VSCode Settings backup
{
// Update Settings
"update.mode": "manual",
"security.workspace.trust.untrustedFiles": "open",
// Editor Settings
"editor.defaultFormatter": "charliermarsh.ruff",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@mrjxtr
mrjxtr / linear-regression.py
Last active September 6, 2024 05:37
Create a linear regression model with Scikit-Learn
from math import sqrt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_error
from sklearn.model_selection import train_test_split
df =
target =
X = df.drop(target, axis=1)
y = df[target]
@mrjxtr
mrjxtr / plots_save.py
Last active October 12, 2024 11:20
Saves figures generated with Matplotlib/Seaborn to PNG format to a specified directory.
def export_figs(export_dir: str, fig: str, fig_number: int, filename: str) -> None:
"""function to export figures generated with matplotlib/seaborn.
Converts figures to png format and saves them to a specified directory.
Args:
export_dir (str): the directory to export the figure to.
fig (str): the figure generated to export.
fig_number (str): the number of the figure based on it's position in the list.
filename (str): the name you want to give the figure.
@mrjxtr
mrjxtr / dynamic-path.py
Last active October 12, 2024 11:12
Snippet to use dynamic path to read data from your data directory relative to current file directory.
import os
import numpy as np
import pandas as pd
# Load data
script_dir = os.path.dirname(__file__)
data_path = os.path.abspath(os.path.join(script_dir, '../data/$1/$2'))
# Read data into a DataFrame