Drafts

Draft and unpublished posts

0 posts

Installing brew on linux proved quite easy and got pyenv running for me within 4 commands.

I had never used homebrew before, honestly I thought it was a mac only thing for years. Today I wanted to try out pyenv, and the reccommended way to install was using homebrew. I am not yet sure if I want either in my normal workflow, so for now I am just going to pop open a new terminal and install homebrew and see how it goes.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/walkers/.zprofile eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"

That was it, now homebrew is working. Starting a new shell and running the command to install pyenv worked.

When I first moved to vim from and ide like vscode or sublime text one of my very first issues was trying to preview my website at localhost:8000. There had always just been a button there to do it in all of my other editors, not vim. There are not many buttons for anything in vim. While there is probably a plugin that can run a webserver for me in vim, it’s not necessary, we just need the command line we are already in.

You will need a way to run another process alongside vim, here are a couple ideas to get you going that are not the focus here.style

Python already exists on most linux systems by default, and most are now on python3. If you are on windows typing python will take you directly to the windows store to install it, or you can also use wsl.

# python3 python -m http.server # running on port 5000 python -m http.server --directory markout 5000

# for the low chance you are on python2 python -m SimpleHTTPServer # running on port 5000 python -m SimpleHTTPServer 5000 python -m SimpleHTTPServer --directory markout 5000 

...

Many command line tools can output a list of files, this is quite powerful. I often want to search for something, then open it from a fuzzy picker. This can be done with fzf in the terminal, but often I am already in vim and I want to open it inside my current session.

how to pass a custom command to telescope

Telescope is the fuzzy file finder I use every day inside of neovim. Its pretty fantastic and easy to extent like this. This first example I am only passing in files from the current working directory by using ls.

:Telescope find_files find_command=ls

This brings up a normal Telescope picker with results from the ls command.

...

vim

Finding hidden files using Telescope as you fuzzy file finder is not too hard, its a single flag passed in. Then it will use whichever file finder it can find [‘fd’, ‘fdfind’, ‘rg –files’, ‘find’, or ‘where’] in that order. These tools each have their own way of handling hidden files, but telescope takes care of that so all you need to do is pass in hidden=true.

I have this keymap set to help me list out all files including hidden files using the pnumonic go edit hidden. I use ge for quite a few different things to take me directly to a specific file or picker.

nnoremap geh <cmd>Telescope find_files hidden=true<cr>

see the implementation telescope finds your files.

vim

Lately I’ve been on a journey to really clean up my dotfiles, and I was completely missing fonts. I noticed jumping into a new vm I had a bunch of broken devicons when using Telescope with the devicons plugins.

This is one of those things that can be a total pain to get right on some systems, and it’s so nice when it’s just there for you pretty much out of the box.

- name: ensure fonts directory file: path: "{{ lookup('env', 'HOME') }}/.fonts" state: directory - name: Hack exists shell: "ls {{ lookup('env', 'HOME') }}/.fonts/Hack*Nerd*Font*Complete*" register: hack_exists ignore_errors: yes - name: Download Hack when: hack_exists is failed ansible.builtin.unarchive: src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip dest: "{{ lookup('env', 'HOME') }}/.fonts/" remote_src: yes

...

Part of my neovim setup requires having the black python formatter installed and callable. I install it with pipx so that I don’t have to manage a virtual environment and have it available everywhere. So far this works well for me, if there are ever breaking changes I may need to rethink this.

re-installing a bunch of things that are already installed can be quite a waste and really add up to my ansible run time, so for most of my ansible tasks that install a command like this I have been following this pattern.

- name: check is black installed shell: command -v black register: black_exists ignore_errors: yes - name: install black when: black_exists is failed shell: pipx install black

Adding a __render__ method that returns a rich renderable to any python class makes it display this output if printed with rich. This also includes being nested inside a rich Layout.

Fugitive comes with a pretty sick way to commit files and see the diff at the same time with verbose commit. Opening the fugitive menu with :G brings up your git status, you can stage files with s, unstage them with u, toggle them with -, and toggle their diff with >. Once you have staged your files for commit, you can commit with cc, but today I found that you can commit verbose with cvc. This brings up not only a commit widow with your git status shown, but the diff that you are about to commit.

example of a verbose commit in fugitive

Kedro Course

find all nodes with raw in the name

use parameters

make and use a logger

...

1 min read

Uses

This is a listing of all the things that I use on a daily basis to build data pipelines, lead my team, and build this website.

[[ uses-2021 ]]

Everything installed on my machines is done through ansible-playbooks. It’s been a long transformation to get here, but its so satisfying to boot a brand new system, run a single command a have every single thing cofigured exactly to my liking.

...

Update Alternatives in Linux

update-alternatives --query python update-alternatives: error: no alternatives for python sudo update-alternatives --install /usr/local/bin/python python `which python3.8` 2 # update-alternatives: using /usr/bin/python3.8 to provide /usr/local/bin/python (python) in auto mode sudo update-alternatives --install /usr/local/bin/python python `which python2.7` 5 # update-alternatives: using /usr/bin/python2.7 to provide /usr/local/bin/python (python) in auto mode update-alternatives --query python # Name: python # Link: /usr/local/bin/python # Status: auto # Best: /usr/bin/python2.7 # Value: /usr/bin/python2.7 # # Alternative: /usr/bin/python2.7 # Priority: 5 # # Alternative: /usr/bin/python3.8 # Priority: 2 sudo update-alternatives --install /usr/local/bin/python python `which python3.8` 20 # update-alternatives: using /usr/bin/python3.8 to provide /usr/local/bin/python (python) in auto mode

How I deploy my blog in 2022

Content at the speed of thought.

well, as fast as I can type

Please ask questions in slido # 983 911 | App Dev 1 Track

...

7 min read

How I deploy my blog in 2021

Content at the speed of thought.

well, as fast as I can type

Please ask questions in slido # 983 911 | App Dev 1 Track

...

7 min read

Kedro-Broken-Urls

Broken Urls # https://github.com/josephhaaga) [ ] https://example.com/file.h5 https://raw.githubusercontent.com/kedro-org/kedro/develop/static/img/pipeline_visualisation.png https://example.com/file.txt https://github.com/jmespath/jmespath.py. https://github.com/tsanikgr) https://example.com/file.csv https://kedro.readthedocs.io/en/latest/04_user_guide/15_hooks.html https://kedro.readthedocs.io/en/stable/07_extend_kedro/04_hooks.html https://github.com/EbookFoundation/free-programming-books/blob/master/books/free-programming-books.md#python https://github.com/quantumblacklabs/private-kedro/blob/develop/docs/source/04_user_guide/04_data_catalog.md http://example.com/api/test https://example.com/file.parquet https://kedro.readthedocs.io/en/stable/11_faq/01_faq.html#how-do-i-upgrade-kedro https://example.com/file.xlsx https://www.datacamp.com/community/tutorials/docstrings-python https://github.com/mmchougule) https://example.com/file.tf...
1 min read

Notes for second vim-fundamentals course meetup

newline another

Mahesh Subrajmanium Venkatachalam - Plugins | Installing a Theme Hunter Phillips - Quickfix | Offline Ordering with getqflist Andrea Wackerle - Search & Replace | Macros

Matthew Fletcher - Registers | Advanced Motions Jump, Delete, & Select | Advanced Motions: Paste & Move Nicholas Payne - My First Vim Plugin | What Makes a Good Plugin Zev Averbach - Harpoon | Wrap up

...

1 min read

Kedro Pipeline Create

Kedro pipeline create is a command that makes creating new pipelines much easier. There is much less boilerplate that you need to write yourself.

https://youtu.be/HtyIKqlEoNw

The kedro cli comes with the following command to scaffold out new pipelines. Note that it will not add it to your pipeline_registry, to be covered later, you will need to add it yourself.

...

notify-send

xinput float $(xinput list --id-only &#34;AT Translated Set 2 keyboard&#34;) | notify-send &#34;laptop keeb floated&#34; -i ~/Pictures/8bitcc.png

RC Plane 3

Steam achievements and progress for RC Plane 3 - 4.44% complete with 2/45 achievements unlocked.

5 min

Copy and Paste on Linux

These are the notes that I used as I set up my first ever ubuntu desktop.

sudo apt install gnome-tweaks

nordix gtk theme #

I ran this, but have no idea if it had any effect as the theme did not show up until I relogged.

gsettings set org.gnome.desktop.wm.preferences theme Nordic

What I think actuagnome terminal showing scrollbar in tmuxlly worked was

...