Skip to content

Instantly share code, notes, and snippets.

View LinuxIsCool's full-sized avatar
💭
Preparing the ship.

Shawn Anderson LinuxIsCool

💭
Preparing the ship.
View GitHub Profile
@LinuxIsCool
LinuxIsCool / vim_spell_quickstart.md
Last active November 20, 2023 22:30
Vim Spellcheck Quickstart

Turn Vim Spell On: :set spell

You should now see miss-spelled words underlined.

Correcting Words:

Recommend Correct Spelling (while cursor is on word): z=

@LinuxIsCool
LinuxIsCool / gradient_fill.py
Created September 23, 2023 20:32
Gradient colored area plot with holoviz
import datashader as ds
import holoviews as hv
import hvplot.pandas
import numpy as np
import pandas as pd
import panel as pn
from holoviews.operation.datashader import datashade
# Sample data
@LinuxIsCool
LinuxIsCool / search-python-code.fish
Last active September 21, 2023 23:51
Interactively search your systems python files with ripgrep, fzf, and fish shell. Open the result with nvim.
# This is a handy utility function to search your entire systems python files for search terms. Requires fzf ripgreg and fish shell
function search-python-code
set term $argv[1]
set selected_line (rg --glob '*.py' --glob '*.ipynb' $term ~/ -n | fzf --preview 'echo {}' --preview-window=up:3:wrap)
if test -n "$selected_line"
set file (echo $selected_line | cut -d: -f1)
set line (echo $selected_line | cut -d: -f2)
nvim $file +$line
end
end
@LinuxIsCool
LinuxIsCool / jupyter-tips.md
Last active August 2, 2023 19:34
Jupyter Lab Pro Tips

Jupyter Tips Threads ✨

  1. Use jupyterlab-unfold for directory tree views: pip install jupyterlab-unfold
  2. <ctrl,> to toggle settings
  3. Use Tabulator and Panel for making interactive data explorers: https://panel.holoviz.org/reference/widgets/Tabulator.html
  4. Use Hvplot Explorer for exploring new data: https://hvplot.holoviz.org/user_guide/Explorer.html - Learn about hvplot explorer here: https://www.youtube.com/watch?v=QbPHVcyAGx8
  5. Use icecream for logging and printing: https://github.com/gruns/icecream
from icecream import ic
ic.configureOutput(prefix='',outputFunction=print)
@LinuxIsCool
LinuxIsCool / fish-fzf-xdg.md
Created May 28, 2023 04:28
Exploring `$XDG_` with `set | fzf ` in fish shell

Thoughts on XDG Fish and FZF:

The DotFiles Can be Installed Using Stow as seen in stow.sh.

Or You can symlink or copy specific files into your ~/.config/ and ~/.local/ and ~/ directories.

That can be configured with $XDG_ variables.

In fish shell, you can explore your $XDG_ settings with fzf.

@LinuxIsCool
LinuxIsCool / configs_update.md
Last active May 28, 2023 04:26
YGG Terminal Configs Update - Nvim + Alacritty + Tmux
@LinuxIsCool
LinuxIsCool / icecream.py
Last active April 8, 2023 22:01
Convenient terminal logging for python panel app development.
from icecream import ic
ic("🌈")
ic("------------------------")
ic("Vyper Examples Panel App")
# Reference: https://github.com/gruns/icecream
@LinuxIsCool
LinuxIsCool / param-panel-value-format.py
Last active April 5, 2023 02:42
Overriding Default Value Formatting in Panel Param
"""
This class automatically formats numbers to be pretty with commas, and also automatically applies steps to number params.
Is there a better way to do this?
Inspiration from here: https://discourse.holoviz.org/t/return-int-value-but-show-labels-on-the-screen-insead-of-int-for-param-integer/2141/2
See also here for formatting: https://docs.bokeh.org/en/latest/docs/reference/models/formatters.html#bokeh.models.NumeralTickFormatter
"""
import numbers
@LinuxIsCool
LinuxIsCool / poetry-ape-vyper-init.md
Created March 19, 2023 18:45
Learning Vyper and ApeworkX Together. Packaging with Poetry.

Initializing an Ape Vyper Python Package with Poetry

Setup a Vyper working directory and an example directory for our package

mkdir Vyper
cd Vyper
mkdir example
cd example