Skip to content

Instantly share code, notes, and snippets.

View LazyRen's full-sized avatar
🇰🇷
Work Hard to be Lazy

Lee, DaeIn LazyRen

🇰🇷
Work Hard to be Lazy
View GitHub Profile
@LazyRen
LazyRen / alias.zsh
Created March 15, 2024 01:04
Remove zsh history entry
# Use TAB to select entries to delete
# Run `fc -R` to reload history file from a current shell.
alias hfzf='history -w; cat ~/.zsh_history | fzf -m > /tmp/to_remove; grep -vxFf /tmp/to_remove ~/.zsh_history > ~/.new_zsh_history; mv ~/.new_zsh_history ~/.zsh_history; rm /tmp/to_remove; history -r'
@LazyRen
LazyRen / git_aliases.zsh
Last active November 3, 2023 02:33
git-related alias.
alias ga="git add"
alias gaa="git add --all
"
alias gb="git branch"
alias gba="git branch -a"
# Delete all local branches except for the current & master
alias gbd="git branch | grep -v '$(git branch --show-current)\|master' | xargs git branch -D"
alias gc="git commit"
alias gca="git commit --amend"
#!/bin/bash
while "$@"; do :; done
CompileFlags:
Add: -ferror-limit=0
InlayHints:
Designators: Yes
Enabled: Yes
ParameterNames: Yes
DeducedTypes: Yes
Diagnostics:
@LazyRen
LazyRen / lock_free_bounded_queue.cpp
Created December 4, 2019 15:29
Implementation of simple lock free bounded queue in C++
#include <atomic>
#include <chrono>
#include <cinttypes>
#include <cstdio>
#include <thread>
using namespace std;
#define NUM_PRODUCER 4
#define NUM_CONSUMER NUM_PRODUCER
#define NUM_THREADS (NUM_PRODUCER + NUM_CONSUMER)
@LazyRen
LazyRen / tmux.conf
Last active January 22, 2021 07:41 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
set-option -g default-shell $SHELL
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
@LazyRen
LazyRen / vim.ahk
Last active November 12, 2020 09:07
vim like arrows & move functions
;###############################################
;Disable CapsLock
;###############################################
CapsLock::
SetCapslockState, Alwaysoff
return
;###############################################
;Control + CapsLock -> CapsLock
;###############################################
@LazyRen
LazyRen / quicksort.cpp
Last active July 1, 2020 05:05
Quick Sort Algorithm
template <typename T>
void swap(T& a, T& b) {
T tmp = a;
a = b;
b = tmp;
}
/*
* Sort all elements in arr[]; range of closed interval [left, right].
*/
@LazyRen
LazyRen / heap.cpp
Last active June 14, 2020 19:15
STL priority_queue-like data structure implementation
template <typename T>
class Heap {
private:
using size_type = size_t;
T* arr;
size_type _size;
size_type _capacity;
bool is_max_heap;
static constexpr size_type DEFAULT_CAP = 32;
@LazyRen
LazyRen / vector.cpp
Last active June 14, 2020 18:24
STL vector-like data structure implementation
#include <cstddef>
#include <utility>
template <typename T>
class Vector {
private:
using size_type = size_t;
T* arr;
size_type _size;
size_type _capacity;