Skip to content

Instantly share code, notes, and snippets.

View koma75's full-sized avatar

Yasuhiro Okuno (Koma) koma75

  • Japan
View GitHub Profile
@koma75
koma75 / Editor_Config.md
Created October 31, 2024 10:52
Editor Config Sample

Editor Config sample

Editor Config can set default settings. All .editorconfig file are included that are in the CWD or it's parent directories until root directory is reached, or an .editorconfig file with root = true is found. For conflicting definitions, .editorconfig file closer to CWD takes precedence, and definitions closer to the bottom of file is prioritized.

# top-most EditorConfig file
@koma75
koma75 / Set-Unset_Proxy_scripts.md
Last active October 31, 2024 09:55
Setting/Unsetting Windows Proxy variables in PWSH

How to set proxy environment for cli tools

Put the following scripts in some globally accessible path. Set the path in the PATH environment variable. Currently support tools that uses the standard HTTP_PROXY and HTTPS_PROXY environment variables (such as git and chocolatey) and have a separate setting for npm.

npm settings are persistent, so once it is set, the proxy config will propagate to next sessions of the terminal and will require active unset. $ENV are not set persistent.

@koma75
koma75 / WindowsShellCustomization.md
Last active October 31, 2024 03:43
CMD and PWSH customization using oh-my-posh and clink

Windows shell customization

PowerShell

first install latest powershell winget Microsoft.PowerShell

Also install some tools

winget gsudo
@koma75
koma75 / venv.bat
Last active June 24, 2022 02:42
venv setup batch file with some environment variable setup
title WINDOWTITLE
REM set HTTP_PROXY=http://localhost:8089
REM set HTTPS_PROXY=http://localhost:8089
if not exist .venv python -m venv .venv
REM start D:\Programs\Tools\yappa\yappa.exe
cmd /k .venv\Scripts\activate.bat
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@koma75
koma75 / hashchk.py
Created January 27, 2017 04:56
Simple hash digest check script for python
import hashlib
import sys
argvs = sys.argv
argc = len(argvs)
if (argc != 2):
print 'Usage: # python %s filename' % argvs[0]
quit()
else:
@koma75
koma75 / .upchk.sh
Last active August 29, 2015 14:16
host connection check function. useful for `upchk somehost && ssh somehost` to wait when somehost is rebooting etc.
#!/bin/bash
upchk() {
if [ $# -eq 0 ]; then
echo "usage: upchk <host|ip>"
return -1
fi
local HOST=$1
echo checking $HOST
rc=1
@koma75
koma75 / Rakefile
Created September 5, 2014 07:14
Rakefile to convert bmp screenshots to png and create thumbnails. (requires ImageMagick)
# encoding: utf-8
require 'rake/clean'
BMP_SRCS = FileList["*.bmp"]
PNG_SRCS = BMP_SRCS.ext('png')
OUT = PNG_SRCS.pathmap('%X_thumb.png')
MAGIC = "convert"
THUMBSIZE = "300x300"
@koma75
koma75 / .alm.sh
Last active August 29, 2015 14:05
simple egg timer function for bash
alm() {
if [ $# -eq 3 ]; then
local SEC=$3
local MIN=$2
local HR=$1
fi
if [ $# -eq 2 ]; then
local SEC=$2
local MIN=$1
local HR='0'
@koma75
koma75 / run_backup_msys.sh
Last active August 29, 2015 14:05
a variant of the rsync based incremental backup for MSYS. (since ln is not properly implemented in msys)
#!/bin/bash
#
# BACKUP Basic info
#
# target path to backup. put a trailing / if you want rsync to back up
# the contents of the directory to the backup dir instead of the directory
# itself
TARGET=