Skip to content

Instantly share code, notes, and snippets.

View unsafe9's full-sized avatar

unsafe9

  • COM2US ROCA
  • Korea
View GitHub Profile
# export
git diff > changes.patch
# import
git apply --reject --whitespace=fix changes.patch
#!/bin/bash
# cloud init
HOME_USER="ec2-user"
dnf update
# install docker
dnf install -y docker
@unsafe9
unsafe9 / oh-my-zsh
Last active December 19, 2023 02:37
# install zsh
sudo apt install -y zsh
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install antigen
curl -L git.io/antigen > ~/.antigen.zsh
# init antigen
#!/bin/bash
# Parse command line arguments
while [ $# -gt 0 ]; do
case $1 in
#--env=*) export ENV="${1#*=}"; shift;;
--env) export ENV="$2"; shift 2;;
*) args+=("$1"); shift;;
esac
done
import os
import subprocess
from pathlib import Path
import venv
CURRENT_DIR = Path(__file__).resolve().parent
PROJECT_DIR = CURRENT_DIR.parent
VENV_NAME = "venv"
VENV_PATH = PROJECT_DIR / VENV_NAME
CONFIG_DIR = PROJECT_DIR / "config"

Intellij IDEA Ultimate helpful keymap settings

Windows

  • Main Menu > Edit > Redo : Ctrl+Y
  • Main Menu > Window > Editor Tabs > Editor Close Actions > Close Tab : Ctrl+W
  • Main Menu > Window > Editor Tabs > Reopen Closed Tab : Ctrl+Shift+T
  • Tool Windows > Terminal : Alt+J
  • Other > Bookmarks > Select File in Project View : Ctrl+;
@unsafe9
unsafe9 / naver-cafe-cleaner.js
Last active February 13, 2023 13:44
네이버카페 댓글지우기
/*
네이버카페 작성댓글 페이지 접속시 전체선택 -> 삭제를 자동으로 실행하는 스크립트입니다.
1. 크롬 확장 프로그램 scripty 설치 https://chrome.google.com/webstore/detail/scripty-javascript-inject/milkbiaeapddfnpenedfgbfdacpbcbam
2. Add New Script
3. Javascript Code 에 아래 코드 복사
4. Run script if -> URL -> Contains 조건에 작성댓글 페이지 주소 넣기 (네이버카페 -> 나의활동 -> 내가 쓴 댓글보기 우클릭 -> 링크 주소 복사)
5. Trigger -> Automatically -> On Page Load
4번에서 복사해넣은 주소로 접속하면 대충 1초에 한페이지씩 삭제됩니다. 다 삭제되면 scripty 에서 스크립트 비활성화 하면 됨.
import glob
import chardet # pip install chardet
def decode(d, preferred_encodings):
for e in preferred_encodings:
try:
return d.decode(e)
except UnicodeDecodeError:
pass
package util
import (
"reflect"
"strings"
)
var fieldNamesByTag = make(map[reflect.Type]map[string]map[string]string)
func BuildFieldsByTagMap(s interface{}, key string) {
@unsafe9
unsafe9 / _gvm_export.bat
Created March 30, 2020 01:39
open go terminal by version
@echo off
if defined GVM_VERSION (
echo ERROR: Cannot export on gvm terminal
exit /b
)
set GVM_VERSION=%1
set GOROOT=C:\Go%1
set GOPATH=E:\golang%1
set PATH=%PATH%;%GOROOT%\bin;%GOPATH%\bin