Skip to content

Instantly share code, notes, and snippets.

@gyorb
gyorb / init.lua
Last active September 1, 2025 05:11
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
@gyorb
gyorb / keybindings.json
Last active April 5, 2019 18:19
keybindings.json
[
//{"key": "ctrl+t", "command": "workbench.action.terminal.focus", "when": "!terminalFocus"},
//{"key": "ctrl+t", "command": "workbench.action.terminal.toggleTerminal", "when": "terminalFocus"},
{"key": "ctrl+t", "command": "workbench.action.terminal.toggleTerminal"},
//{"key": "ctrl+x", "command": "workbench.action.evenEditorWidths"},
//{"key": "ctrl+x", "command": "workbench.action.maximizeEditor"},
//{"key": "ctrl+x", "command": "workbench.action.nextPanelView"},
//{"key": "ctrl+x", "command": "workbench.action.openView"},
//{"key": "ctrl+x", "command": "workbench.action.quickOpenView"},
{"key": "ctrl+x", "command": "workbench.action.togglePanel"},
@gyorb
gyorb / brunch.py
Last active August 26, 2017 22:15
brunch pattern
# named by Alex Martelli in the Python Cookbook
class Bunch(dict):
def __init__(self, *args, **kwds):
super(Bunch, self).__init__(*args, **kwds)
self.__dict__ = self
{
"window.zoomLevel": 0,
"window.titleBarStyle": "custom",
"workbench.startupEditor": "none",
"editor.fontSize": 12,
"editor.fontFamily": "'Fira Code', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.minimap.enabled": false,
"editor.cursorBlinking": "solid",
"editor.cursorStyle": "line",
@gyorb
gyorb / vim_notes.md
Last active April 21, 2017 08:35
vim_notes

Registers

  • "[1-9] history registers
  • "0 yank register
  • "[a-z] named registers
  • "[A-Z] named registers (append)
  • "/ current search pattern
  • "- small delete
  • "= expression register
  • "_ black hole register
@gyorb
gyorb / timer.py
Created September 28, 2016 16:54
timer contextmanager for profiling
#!/usr/bin/python
from contextlib import contextmanager
from datetime import datetime
import time
@contextmanager
def timer():
before = datetime.now()
yield
@gyorb
gyorb / git_notes.md
Last active May 25, 2018 07:36
git notes

Remove ignored files from your repository's directory

While a regular git clean will ignore them as well, passing the -x switch changes that:

  • Dry run: git clean -xn
  • Clean files: git clean -x
  • Clean by passing the -f (force) or -d (directories): git clean -xdf

Comparing branches/revisions

@gyorb
gyorb / detect_ssd_linux
Created September 2, 2016 09:26
detect ssd on linux
Starting from kernel 2.6.29, SSD disks are automatically detected, and you may verify this with:
cat /sys/block/sda/queue/rotational
You should get 1 for hard disks and 0 for a SSD.
@gyorb
gyorb / arch-linux-install
Last active November 2, 2018 10:24 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing ArchLinux (UEFI, encryption ...)
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdb bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
Check whether the dir ```/sys/firmware/efi``` exists, if it exists it means the kernel has booted in EFI mode.
@gyorb
gyorb / .vimrc
Last active October 13, 2016 11:39
minimal vimrc
set nocompatible
set nu
set nuw=1
set autoread
set t_Co=256
set background=dark
colorscheme elflord
syntax enable