Skip to content

Instantly share code, notes, and snippets.

View ha7ilm's full-sized avatar
🇭🇺

András Retzler ha7ilm

🇭🇺
  • Belgium
  • 14:42 (UTC -12:00)
View GitHub Profile
@ha7ilm
ha7ilm / mathpixlowdpi.md
Created October 27, 2023 14:45
start mathpix lowdpi

Set custom DPI for Mathpix, Nextcloud, etc. on Windows (any Qt app).

image

Target:

C:\Windows\System32\cmd.exe /c "SET QT_SCALE_FACTOR=1.3 && SET QT_AUTO_SCREEN_SCALE_FACTOR=0 && start mathpix-snipping-tool.exe"
@ha7ilm
ha7ilm / synctex.md
Created September 9, 2023 20:20
synctex.md

VS Code Synctex command for SummatraPDF

"C:\Users\YourUsername\AppData\Local\Programs\Microsoft VS Code\Code.exe" -g "%f:%l"

wcd -- cd to a Windows-style path in WSL

What does it do?

user@windows / $ wcd 'C:\Test'
user@windows /mnt/c/Test $

You have to use '' around the path.

@ha7ilm
ha7ilm / LICENSE
Last active July 29, 2023 14:12
Find all referenced files in .tex file and categorize the files in current directory to referenced and non-referenced files
Copyright 2023 Andras Retzler
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT

Command to open vim from Total Commander as external viewer/editor (Alt+F3) through WSL

wt -p "Ubuntu" wsl zsh -c "vim $(wslpath '%1')"

You shall put it to TC settings, where I have the Notepad++ now:

image

#We only need to normalize the inputs of a neural network, not necessarily the outputs.
#However, the choice of the activation function is important, e.g. it doesn't work with `jnp.tanh`.
import jax.numpy as jnp
from jax import grad, jit, vmap
import jax
from jax import random
from flax import linen as nn
from flax.training import train_state
from optax import adam
@ha7ilm
ha7ilm / torch-rfft-derivative.md
Created October 31, 2022 06:06
calculate the derivative of a signal with torch.fft
F_signal = torch.fft.rfft(signal])
w = ((((torch.arange(0,301))/600)*(2*torch.pi))) #signal is 600 samples long
d_signal = torch.fft.irfft(w*torch.tensor(complex(0,1))*F_signal)*(1/dt)
@ha7ilm
ha7ilm / debugnn.md
Created September 2, 2022 10:05
Debugging NNs with PyTorch

This is work in progress.

Visualizing gradients


@ha7ilm
ha7ilm / root_dir_of_git_repo_matlab.m
Last active June 15, 2022 08:46
How to get the absolute path of the root directory of the current git repo in MATLAB
[~,gcr]=system("git rev-parse --show-toplevel"); gcr=strsplit(gcr,newline); gcr=[gcr{1} filesep]; %root of repo
@ha7ilm
ha7ilm / wsl.md
Last active May 23, 2022 16:24
Execute command inside Windows Terminal and WSL

Execute command inside Windows Terminal and WSL

I do it like this:

wt -p "Ubuntu" wsl zsh -c "command_to_execute"
  • Ubuntu is the name of the profile
  • zsh is my shell
  • command_to_execute is what I would type into zsh