Hi! A simple website where I put down some thoughts, code-related cheat sheets, book reviews, and concepts from physics and data science so that I don’t forget :)
Using git bisect to find a bug
Oops, you broke something but don’t know when? Use git bisect!
Auto activating conda environments when moving between projects
A simple script to automatically activate conda environments when moving between projects
Supercharging your terminal with fish and starship
Some cool enhancements to your terminal
How to pass custom prompts to langchain chains
Some examples of how to pass custom prompts to
load_summarize_chain
and load_qa_chain
Google Scripts to label GitLab related emails
How to use email headers to filter and label email notifications from GitLab.
Unit testing - Classical vs. London Approaches
A small post about the need for unit for unit testing in software projects, and the differences between London-style and Classical-style unit-testing.
Debugging gitlab pipeline docker containers
Sometimes a pipeline that is running on GitLab has unexpected behavior, but how do we access the docker image so that we can debug locally?
Git ahoy! A Pirate’s Tale of Version Control
Yo-ho-ho and a bottle of Git! Follow the daring exploits of Captain Blackbeard’s rum-soaked crew as they navigate treacherous seas, correct their plundering mistakes with cunning commits, and master the art of version control on their ship, the Jolly Git Committer.
All about type hinting in Python
What is Type Hinting? Type hinting is a feature introduced in Python 3.5 that allows you to annotate the types of variables, function arguments, and return values. It provides optional typing to the Python language without actually enforcing the types at runtime.
Type hints are used to indicate the expected types of variables and functions, making your code more explicit and self-documenting. They help you catch potential type-related errors early and improve code development and maintainability.
Getting rid of ‘fatal: The current branch has no upstream branch’ in git
How to stop Git from nagging about missing upstream branches by automatically setting the upstream for all new branches.
Mocking context managers with pytest
Mocking functions and methods for unit testing is not so hard, but mocking context managers can be tricky, as sometimes you will need to mock the
__enter__()
method as well…Easy data-scraping using REST API and request package
Often when webpages provide a friendly interface to download data, the data itself is fetched using a REST API. Most web browsers can easily intercept the request, which you can modify and edit. This is convenient if you want to use Python to download a lot of data, or if you want to set up an automated data download pipeline.
Here’s a quick step-by-step guide on how to do so.
Some tips for using VS code for python development
A small (but growing) list of useful tips when developing python in VS code.
Managing git ssh-keys for multiple accounts on GitLab and GitHub
If you only have one account for every git repository provider, for example, one for
www.github.com
and one for www.gitlab.com
, you will need to add the following to your ssh-config file…The Query Likelihood Model
One of the central ideas behind language modeling is that when a user tries to produce a good search query, he or she will come up with terms that are likely to appear in a relevant document. In other words, a relevant document is one that…
Copy large amounts of files over ssh
To copy large amounts of files over ssh you have a few options. The slowest option is using
scp -r
to recursively copy each file one by one, but it is faster and more convenient to first tar or gzip your home directory, copy it over to…How to ssh over WiFi between two machines running wsl
We first follow a tutorial by Scott Hanselman where we will use Windows’ openSSH to handle ssh connections and set the default ssh shell to be bash on wsl.
Setup ssh on your machine Choose one of your two machines to be the host. On the host, we need to first check if OpenSSH.Server is installed. Open powershell with elevated rights and run the following
> Get-WindowsCapability -Online | ? Name -like ‘OpenSSH*’ Name : OpenSSH.
elements
Table of contents Table of contents Text Code Python C/C++ Bash Tables Text Some example text
Code Python def foo(): print ("This is a python function") C/C++ void foo(){ prinf("%s\n", "This is a C function") } Bash # This is a bash command cd dir && echo $PWD; # Return exit 0; Tables Pages Elements 1 Text 2 Code 3 Tables