Skip to content

Instantly share code, notes, and snippets.

View sluger's full-sized avatar

Stefan Luger sluger

View GitHub Profile
@sluger
sluger / delete_git_submodule.md
Created February 9, 2024 09:44 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@sluger
sluger / .zshrc
Created March 21, 2023 10:18 — forked from chrisnolet/.zshrc
Color-coded git branch for zsh prompt
autoload -Uz compinit && compinit
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f"
zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a"
zstyle ':vcs_info:*' stagedstr "%F{green}"
@sluger
sluger / AsyncMuiAutocomplete.test.tsx
Last active December 7, 2022 09:32
Testing MUI (@mui/material) autocomplete component with react-testing-library and async options simulated by a sleep
import Asynchronous from './AsyncAutocomplete';
import { render, screen, fireEvent, waitFor, prettyDOM, within } from '@testing-library/react';
describe('Async autocomplete', () => {
it('renders options', async () => {
render(<Asynchronous></Asynchronous>);
await waitFor(() => expect(screen.getAllByText('Asynchronous')).toBeDefined());
const combobox = screen.getByRole('combobox');
@sluger
sluger / Jest_GitLab_CI.md
Created June 23, 2022 12:38 — forked from rishitells/Jest_GitLab_CI.md
Setting up Jest tests and coverage in GitLab CI

Configuring Jest Tests in GitLab CI

1. Add GitLab CI configuration file in the root

In the root of your project, add .gitlab-ci.yml with the configuration below.

image: node:latest

stages:
@sluger
sluger / Backtick_Behaviour.md
Created September 27, 2018 13:47 — forked from keckelt/Backtick Behaviour.md
Avoid typing backticks twice (on Linux)

The backtick is called grave If the backtick is not typed on your first keyboard button press, but on the second it is a dead grave.

So, find the backtick button keycode for your layout:

xmodmap -pke | grep "grave"

which returns (for my german keyboard layout):

keycode 21 = dead_acute dead_grave dead_acute dead_grave
# perform a fresh install of Ubuntu 17.10
# upgrade the kernel to v4.13.10
mkdir ~/kernel-v4.13.10
cd ~/kernel-v4.13.10
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310_4.13.10-041310.201710270531_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-headers-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.13.10/linux-image-4.13.10-041310-generic_4.13.10-041310.201710270531_amd64.deb
sudo dpkg -i *.deb
@sluger
sluger / zsh.md
Created November 15, 2017 09:39 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu