Skip to content

Instantly share code, notes, and snippets.

@epicserve
epicserve / redis_key_sizes.sh
Last active June 29, 2024 03:41
A simple script to print the size of all your Redis keys.
#!/usr/bin/env bash
# This script prints out all of your Redis keys and their size in a human readable format
# Copyright 2013 Brent O'Connor
# License: http://www.apache.org/licenses/LICENSE-2.0
human_size() {
awk -v sum="$1" ' BEGIN {hum[1024^3]="Gb"; hum[1024^2]="Mb"; hum[1024]="Kb"; for (x=1024^3; x>=1024; x/=1024) { if (sum>=x) { printf "%.2f %s\n",sum/x,hum[x]; break; } } if (sum<1024) print "1kb"; } '
}
@zchee
zchee / actionlist.vim
Last active July 22, 2024 13:13
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@elrrrrrrr
elrrrrrrr / Q_ss
Created January 3, 2016 08:53
vim 插入模式快捷键
*Q_ss* 插入模式特殊键
|i_CTRL-V| CTRL-V {char}.. 按本义插入字符,或插入十进制数的字节值
|i_<NL>| <NL> 或 <CR> 或 CTRL-M 或 CTRL-J
开始新行
|i_CTRL-E| CTRL-E 插入光标下方的字符
|i_CTRL-Y| CTRL-Y 插入光标上方的字符
|i_CTRL-A| CTRL-A 插入上次插入的文本
|i_CTRL-@| CTRL-@ 插入上次插入的文本并结束
@bookfere
bookfere / fix-google-translate-cn.bat
Last active July 10, 2024 03:06
Fix Google Translate CN for Windows
:: Copyright (c)2022 https://bookfere.com
:: This is a batch script for fixing Google Translate and making it available
:: in the Chinese mainland. If you experience any problem, visit the page below:
:: https://bookfere.com/post/1020.html
@echo off
setlocal enabledelayedexpansion
chcp 437 >NUL
set "ips[0]=74.125.137.90"