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 / vyper-vim.md
Last active March 18, 2023 23:36
(Neo)vim working with vyper

Getting Setup for Vyper in Vim

This tutorial assumes that you use vim plug as a package manager.

Add the following to vimrc (using plug PM):

Plug 'vyperlang/vim-vyper'

Source vimrc

@LinuxIsCool
LinuxIsCool / example.py
Created March 16, 2023 22:14 — forked from bhargavkakadiya/example.py
Simple example for Param Panel class interactions
## Run it on jupyter notebook for interactive panel
import param as pm
import panel as pn
class A(pm.Parameterized):
a = pm.Number(2)
class B(pm.Parameterized):
def __init__(self, a:A, **params):
super().__init__(**params)
@LinuxIsCool
LinuxIsCool / pypi-poetry-publishing.md
Created March 11, 2023 00:01
Publishing a Package to Pypi with Poetry

Quick Guide to Pypi Publishing with Poetry

  1. Check that your package name is available by searching on PyPi
    https://pypi.org

  2. Register on PyPi and generate an API token:
    https://pypi.org

  3. Config Poetry with your API token

@LinuxIsCool
LinuxIsCool / poetry-dev.md
Created March 10, 2023 22:47
Remember how to Poetry dev

Remember how to Poetry dev

In this example, panel is the library being installed.

First add the library as dev dependency poetry add --group dev panel

and then install dev dependencies locally poetry install --with dev

@LinuxIsCool
LinuxIsCool / nerdcommenterjsx
Created February 28, 2023 20:16
Commenting in JSX using nerdcommenter
# Put the following in vim config before loading the nerdcommenter plugin:
`let g:NERDCustomDelimiters = {'javascript': { 'left': '//', 'right': '', 'leftAlt': '{/* ', 'rightAlt': ' */}' }}`
# Then, when working on your file, press `<leader>ca` to switch between primary and alternative delimiters.
@LinuxIsCool
LinuxIsCool / dynamic_display_threshold.py
Created November 30, 2022 22:31
Minimum viable embedded app and dynamic display threshold example for python param panel
import param as pm
import panel as pn
pn.extension()
class Protocol(pm.Parameterized):
display_level = pm.Integer(default=1, bounds=(0, 2), step=1, precedence=2)
target_apy = pm.Number(0.15, bounds=(0,1), precedence=1)
total_curve_pool_tvl = pm.Number(1e7, bounds=(0,None), precedence=0)
def __init__(self):
@LinuxIsCool
LinuxIsCool / panel_param.py
Created November 30, 2022 21:45
Most basic python panel param hvplot dataframe example possible.
"""
Run this in a Jupyter Cell
"""
import param as pm
import pandas as pd
import numpy as np
import hvplot.pandas
class A(pm.Parameterized):
@LinuxIsCool
LinuxIsCool / README.md
Created November 20, 2022 02:44 — forked from nikoheikkila/README.md
Fish Shell function for sourcing standard .env files

envsource

I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

.env (line 2): Unsupported use of '='. In fish, please use 'set KEY value'.
from sourcing file .env
source: Error while reading file '.env'