All these files can be found in my dotfile repo
# First we must create the script we want to execute
# scripts should be stored in your $HOME/.local/bin
# The code below is called 'essentials' in my repo
" vim-plug | |
" Press `gx` to open the GitHub URL for a plugin or a commit with the default browser. | |
" From https://github.com/junegunn/vim-plug/wiki/extra#gx-to-open-github-urls-on-browser | |
function! s:plug_gx() | |
let line = getline('.') | |
let sha = matchstr(line, '^ \X*\zs\x\{7,9}\ze ') | |
let name = empty(sha) ? matchstr(line, '^[-x+] \zs[^:]\+\ze:') | |
\ : getline(search('^- .*:$', 'bn'))[2:-2] | |
let uri = get(get(g:plugs, name, {}), 'uri', '') | |
if uri !~ 'github.com' |
from holoviews import Element, Store | |
from bokeh.models import Column | |
from holoviews.plotting.bokeh import ElementPlot | |
class BokehFigure(Element): | |
"""Wraps bokeh figure""" | |
class BokehFigurePlot(ElementPlot): | |
def initialize_plot(self, ranges=None, plot=None, plots=None, source=None): |
function fcd --description "Fuzzy change directory" | |
if set -q argv[1] | |
set searchdir $argv[1] | |
else | |
set searchdir $HOME | |
end | |
# https://github.com/fish-shell/fish-shell/issues/1362 | |
set -l tmpfile (mktemp) | |
find $searchdir \( ! -regex '.*/\..*' \) ! -name __pycache__ -type d | fzf > $tmpfile |
# make CapsLock behave like Ctrl: | |
setxkbmap -option ctrl:nocaps | |
# make short-pressed Ctrl behave like Escape: | |
# Default timeout is 500ms | |
xcape -t 300 -e 'Control_L=Escape' |
It's true packages exist to make it "easy" to use Django inside of a jupyter notebook. I seem to always run into issues successfully running these packages. I've found the below method useful although I cannot recall how I discovered how this works (aka attribution needed).
virtualenv
, venv
, pipenv
, etc)cfehome
).env
file for me sparing me the need to pollute my session with environment variables.
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:
## Run it on jupyter notebook for interactive panel | |
import param as pm | |
import panel as pn | |
pn.extension() | |
class A(pm.Parameterized): | |
a = pm.Number(2, step=1) | |
def get_a_squared(self): | |
return self.a * self.a |