Skip to content

Instantly share code, notes, and snippets.

@wildlarva
wildlarva / minikube-docker-env
Last active June 7, 2019 22:36
A shell environment file to setup a WSL docker environment from minikube
# Usage: source /path-to/minikube-docker-env
eval $(minikube docker-env --shell zsh)
export DOCKER_CERT_PATH=$(wslpath "$DOCKER_CERT_PATH")
@wildlarva
wildlarva / command to register webbrowser.sh for update-alternatives
Last active December 15, 2019 02:41
A shell script to open a web browser from WSL environment. This let you run Jupyter Notebook in WSL.
# Use webbrowser.sh as x-www-browser command
#
# Please follow the instructions below to install:
# 1. Modify the path to webbrowser.sh
# 2. Execute this command
sudo update-alternatives --install /usr/bin/x-www-browser x-www-browser /path-to/webbrowser.sh 1 # Edit this path to point your webbrowser.sh
@wildlarva
wildlarva / focus-input-element-component.html
Last active October 4, 2024 22:26
Focus conditional input element on Angular
<div *ngFor="let task of tasks">
<!-- Use # to set the name of the input element to focus -->
<input #taskInput *ngIf="task.isEditing" type="text" [(ngModel)]="task.name" (blur)="onEdited(task)" (keyup.enter)="taskInput.blur()">
<div *ngIf="!task.isEditing" (dblclick)="onEdit(task)">{{task.name}}</div>
</div>