Skip to content

Instantly share code, notes, and snippets.

View tecandrew's full-sized avatar

Andrew tecandrew

  • Trabus Technologies
  • California, USA
  • 18:35 (UTC -07:00)
View GitHub Profile
@tecandrew
tecandrew / README.md
Created January 18, 2023 02:01
Enable Hyper-V Manager on Windows 11 Home
@tecandrew
tecandrew / reset.sh
Created November 28, 2022 20:53
Reset git submodules (recursive)
#!/bin/bash
git fetch && git reset --hard @{u} && git submodule deinit --all -f && git submodule update --init
@tecandrew
tecandrew / python-problem-matcher.md
Last active November 9, 2022 18:07
Python Problem Matcher for VS Code

VS Code

There is no native Python "problemMatcher" for vscode tasks. Use the regexp pattern to make it work for basic tasks.

"problemMatcher":
    {
        "fileLocation": "absolute",
        "pattern": [
 {
@tecandrew
tecandrew / gitlab-archive-python-api.py
Last active November 9, 2022 18:08
GitLab Archive Using Python API
#!/usr/bin/env python3
from zipfile import ZipFile
import os
import time
from gitlab import (
Gitlab,
)
API_TOKEN = ''
@tecandrew
tecandrew / pytorch-apple-silicon-test.py
Last active November 9, 2022 18:07
Test Apple M1 Pytorch
import torch
import math
# this ensures that the current MacOS version is at least 12.3+
print(torch.backends.mps.is_available())
# this ensures that the current current PyTorch installation was built with MPS activated.
print(torch.backends.mps.is_built())
dtype = torch.float
device = torch.device("mps")
@tecandrew
tecandrew / wsl-1password-integration.md
Last active January 28, 2024 14:11
WSL/WSL2 Integration with 1Password SSH

On Windows Side

Enable 1Password's SSH Agent.

Using Powershell, install npiperelay via the scoop package manager.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time
irm get.scoop.sh | iex  # install scoop
scoop bucket add extras
@tecandrew
tecandrew / init.vim
Created July 27, 2022 21:43
a .vimrc file for neovim for 4-spaced tabs. place in ~/.config/nvim/
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu