Skip to content

Instantly share code, notes, and snippets.

@rnyrnyrny
rnyrnyrny / wezterm.lua
Last active May 29, 2023 08:25
a simple wezterm config that I use
-- I recently switched from alacritty to wezterm. Supports mouse scrolling, has builtin emoji and multi-tab support. So far so good.
-- The config is in lua that I don't know much about. But the official doc has an example config to start with.
-- Pull in the wezterm API
local wezterm = require 'wezterm'
-- This table will hold the configuration.
local config = {}
-- In newer versions of wezterm, use the config_builder which will
@rnyrnyrny
rnyrnyrny / logger.go
Last active March 20, 2023 14:26
log using uber zap and lumberjack (zapcore.AddSync version)
// thanks to:
// https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// https://studygolang.com/articles/17394
// https://stackoverflow.com/questions/54395407/zap-logging-with-1-customized-config-and-2-lumberjack
// Please test and debug it before putting it in production.
package logger
import (
"fmt"
"os"
@rnyrnyrny
rnyrnyrny / alacritty.yml
Created May 20, 2021 03:42
my alacritty config file for win10 wsl2
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Import additional configuration files
#
# Imports are loaded in order, skipping all missing files, with the importing
# file being loaded last. If a field is already present in a previous import, it
# will be replaced.
#
# All imports must either be absolute paths starting with `/`, or paths relative
# to the user's home directory starting with `~/`.
@rnyrnyrny
rnyrnyrny / logger.go
Last active October 23, 2023 05:28
log using uber zap and lumberjack
// NOTE
// This gist was created long time ago.
// According to zap's doc, now we can use zapcore.AddSync to directly add lumberjack as a zap sync
// see https://github.com/uber-go/zap/blob/master/FAQ.md#does-zap-support-log-rotation
// So I wrote a new gist if anyone is interested:
// https://gist.github.com/rnyrnyrny/a6dc926ae11951b753ecd66c00695397
// 下面的代码已经过时了,现在直接用zapcore.AddSync就行,参考zap文档
// thanks to:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# test
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@rnyrnyrny
rnyrnyrny / functions.sh
Created December 20, 2018 02:08 — forked from junegunn/functions.sh
Key bindings for git with fzf (https://junegunn.kr/2016/07/fzf-git/)
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% "$@" --border
}
@rnyrnyrny
rnyrnyrny / cVimrc
Created May 9, 2018 02:50
config for Chrome extension cVim
" alias ':g' to ':tabnew google'
command g tabnew google
@rnyrnyrny
rnyrnyrny / .tmux.conf
Last active April 24, 2023 07:31
my tmux conf
set-option -g default-shell /usr/local/bin/zsh #up to you
unbind ^b
set -g prefix M-q
#set -g utf8 on
#set -g status-utf8 on
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
@rnyrnyrny
rnyrnyrny / reclaimWindows10.ps1
Created April 17, 2018 02:40 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults)
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.12.1, 2018-03-15
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@rnyrnyrny
rnyrnyrny / main.go
Created January 9, 2018 01:57 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"