Skip to content

Instantly share code, notes, and snippets.

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@roberthamel
roberthamel / docker-swarm-gpu.md
Created November 4, 2022 18:02 — forked from tomlankhorst/docker-swarm-gpu.md
Instructions for Docker swarm with GPUs
@roberthamel
roberthamel / code.sh
Created October 3, 2022 12:28 — forked from tallguyjenks/code.sh
ZettelKasten Sync Code
# To permanently cache the credentials
git config --global credential.helper store
# To ignore files that could cause issues across different workspaces
touch .gitignore
echo ".obsidian/cache
.trash/
.DS_Store" > .gitignore
@roberthamel
roberthamel / main.go
Created May 26, 2022 02:49
golang download progress
// https://golangcode.com/download-a-file-with-progress/
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
@roberthamel
roberthamel / dnsmasq OS X.md
Created May 20, 2022 03:48 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@roberthamel
roberthamel / full_upsert.py
Last active May 18, 2022 19:44 — forked from nirizr/full_upsert.py
sqlalchemy upsert
def upsert(session, model, rows):
table = model.__table__
stmt = postgresql.insert(table)
primary_keys = [key.name for key in inspect(table).primary_key]
update_dict = {c.name: c for c in stmt.excluded if not c.primary_key}
if not update_dict:
raise ValueError("insert_or_update resulted in an empty update_dict")
stmt = stmt.on_conflict_do_update(index_elements=primary_keys,
@roberthamel
roberthamel / rancher-docker.sh
Created January 9, 2021 15:42
rancher-docker
docker run -d --restart=unless-stopped \
--name rancher \
-p 80:80 -p 443:443 \
-v $HOME/srv/rancher:/var/lib/rancher \
--privileged \
rancher/rancher
@roberthamel
roberthamel / uninstall-k3s.sh
Created December 22, 2020 15:49
uninstall k3s
#!/usr/bin/env bash
set -euo
k3s-uninstall.sh
docker container kill $(docker ps -q)

Vim

Finding Your Way Around

Download MacVim (optional)

MacVim

Set up Oh-my-zsh (optional)

Unit Tests in Vue.js

Tooling

{
  "karma-mocha": "^0.2.1",
  "karma-chai": "^0.1.0",
  "karma-chai-as-promised": "^0.1.2",
  "karma-sinon": "^1.0.4",