Skip to content

Instantly share code, notes, and snippets.

View techboy-coder's full-sized avatar

Shivram Sambhus techboy-coder

View GitHub Profile
@techboy-coder
techboy-coder / welcome.zsh
Created February 23, 2024 10:00 — forked from mikechernev/welcome.zsh
A welcome message when loading zsh
#!/bin/zsh
dragonColour=11
textColour=2
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
secs=$((${upSeconds}%60))
mins=$((${upSeconds}/60%60))
hours=$((${upSeconds}/3600%24))
days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@techboy-coder
techboy-coder / rolling_window.py
Created December 16, 2020 13:38 — forked from seberg/rolling_window.py
Multidimensional rolling_window for numpy
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True):
"""Create a view of `array` which for every point gives the n-dimensional
neighbourhood of size window. New dimensions are added at the end of
`array` or after the corresponding original dimension.
Parameters
----------
array : array_like
Array to which the rolling window is applied.
window : int or tuple