Skip to content

Instantly share code, notes, and snippets.

View yuvve's full-sized avatar

yuvve

  • Sweden
  • 21:30 (UTC +02:00)
View GitHub Profile
@yuvve
yuvve / overleaf-traefik-instructions.md
Last active September 7, 2024 18:43
Run Overleaf with Traefik

Overleaf

To add Overleaf to your Traefik stack you should use the Overleaf Toolkit with very minimal adjustments (taken from this issue comment).

Please read the quick start guide and config guide.

Toolkit configuration

  1. Clone the toolkit repo into your server
  2. run toolkit/bin/init
  3. Edit config/overleaf.rc (more info) to your liking, make sure that:
    1. OVERLEAF_LISTEN_IP=0.0.0.0
@yuvve
yuvve / settings.json
Created July 11, 2024 18:32
VSCode settings for correct autocomplete and linting when working with subfolders in Python
{
"python.autoComplete.extraPaths": ["./app"],
"pylint.args": [
"--rcfile=${workspaceFolder}/app/"
],
"python.analysis.extraPaths": [
"./app"
]
}
@yuvve
yuvve / transfer.m
Last active May 20, 2024 18:11
MATLAB transfer function information
%% Transfer function information
% This script takes either polynomial coefficients for the numerator and denominator
% OR zero and pole locations (factorized roots) + gain
% OR characteristic equation (undamped natural frequency and damping ratio)
% of a system with a second order complex pole
% of the transfer function of a system, and then returns:
% 1. A graph of system's impulse response.
% 2. A graph of the system's step response.
% 3. The pole-zero diagram of the system.
% 4. The factorized transfer function printed with LaTeX.
@yuvve
yuvve / pythonpath.md
Created March 1, 2024 13:31
Manually setting Pythonpath

Manually setting Pythonpath

Linux

export PYTHONPATH=path

For current working directory:

export PYTHONPATH=.

Windows

@yuvve
yuvve / launch.json
Last active June 4, 2024 11:21
VSCode launch settings for Python, Pytest and Scrapy, that add the VSCode workspace to path
// Using the launch settings below,
// you can debug (F5) modules inside subfolders
// that import files from parent- or sister folders
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Run Module With Path",
"type": "python",
"request": "launch",
@yuvve
yuvve / MullvadAdGuardAndroidRooted.md
Last active January 24, 2024 20:55
How to use AdGuard ad filtering capability together with Mullvad VPN on a rooted Android device

AdGuard ad filtering + Mullvad VPN

Sources

Steps

  1. Open AdGuard and go to Apps → Mullvad VPN → Disable routing through AdGuard.
  2. (In AdGuard) go to Settings → Filtering → Network → Routing Mode and choose Automatic Proxy.
  3. (In AdGuard) and go to Settings → Filtering → Network → Proxy → Proxy server.
  4. Tap the Add proxy server and fill in the fields:
@yuvve
yuvve / diffisar.md
Last active January 21, 2023 12:53
Diffisar M0049M

Differentialekvationer (M0049M) 2022-10-21 09 55 47 excalidraw

@yuvve
yuvve / Obsidian Git-Mobile.md
Last active May 4, 2024 08:53
Automatically sync notes to and from git repository whenever you open and close Obsidian on mobile.

How to automatically sync Obsidian between Github and Android with Termux and Tasker

I use Obsidian git on PC, and this workaround (since the plugin doesn't support mobile) to seamlessly* sync my notes to and from my phone. Using these instructions you create an automation for pulling every time you open Obsidian, and pushing every time you close it.

* you can still get merge conflicts...

Preparation

  1. Install Tasker.
  2. Install Termux.
  3. Install Termux tasker plugin.
  4. Open Termux and write termux-setup-storage, give it permissions.
@yuvve
yuvve / MIPS_bit_splitter.py
Created May 23, 2022 17:55
Makes it easier to read machine code by splitting the bits depending on the MIPS instruction
def i_type(s):
op = s[0:6]
rs = s[6:11]
rt = s[11:16]
imm = s[16:]
return f"{op} {rs} {rt} {imm}"
def r_type(s):
op = s[0:6]
rs = s[6:11]
@yuvve
yuvve / obsidian_anki_regex_clipboard.py
Last active March 31, 2023 09:31
Takes Obsidian formatted string from clipboard and replaces it with Anki formatted string
import re, pyperclip
# Changes
# $...$ to \(...\)
# $$...$$ to \[...\]
# [[a|b]] to b
# }} to } }
# *abcd* to <i>abcd</i>
# **abcd** to <b>abcd</b>
# markdown bulleted lists (using -) to html <ul>...</ul>