Skip to content

Instantly share code, notes, and snippets.

View Maghoumi's full-sized avatar

Mehran Maghoumi Maghoumi

View GitHub Profile
mattbell87 /
Last active June 16, 2024 19:30
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
alimanfoo /
Created November 5, 2017 23:53
Find runs of consecutive items in a numpy array.
import numpy as np
def find_runs(x):
"""Find runs of consecutive items in an array."""
# ensure array
x = np.asanyarray(x)
if x.ndim != 1:
raise ValueError('only 1D array supported')
gre / easing.js
Last active June 13, 2024 12:18
Simple Easing Functions in Javascript - see
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
* Easing Functions - inspired from
* only considering the t value for the range [0, 1] => [0, 1]
EasingFunctions = {