Skip to content

Instantly share code, notes, and snippets.

@ecormaksin
ecormaksin / gist:01059883b9c30184128f7bbb82259acb
Created October 10, 2024 14:41
Shortcut Keys to move application windows between monitors
# need to install xdotool
# move to a upper monitor
xdotool getactivewindow windowmove $[DISPLAY_WIDTH] 0
# move to a lower monitor
xdotool getactivewindow windowmove $[DISPLAY_WIDTH] 1201
@ecormaksin
ecormaksin / replaceString.ps1
Created August 3, 2024 02:06
Powershellで文字列を置換するワンライナー
'<置換元の文字列>' -replace '[ \t!]', '_' | Set-Clipboard -PassThru
@ecormaksin
ecormaksin / template.html
Last active July 1, 2024 12:22
HTMLファイルの最小テンプレート
<!DOCTYPE html>
<html lang="ja-JP">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>the simplest HTML template</title>
<link href=".css" rel="stylesheet" type="text/css">
<script src="script.js" defer></script>
</head>
@ecormaksin
ecormaksin / rsync_custom.sh
Last active October 5, 2023 02:12
rsyncによるフォルダー間のコピー(コピー先のみに存在するものは削除)
#!/usr/bin/env bash
cd `dirname $0`
if [ $# -gt 3 ]; then
echo "呼出時の引数: <コピー元ディレクトリー パス> <コピー先ディレクトリー パス> (<除外パターンファイルのパス>)"
exit 1
fi
if [ $# -lt 2 ]; then
@ecormaksin
ecormaksin / mysql_get_users.sql
Created June 13, 2023 01:56
MySQLユーザー一覧
select
Host
, user
, PLUGIN
, AUTHENTICATION_STRING
, PASSWORD_EXPIRED
from mysql.user;
@ecormaksin
ecormaksin / convert_file_to_utf8-lf.sh
Created June 8, 2023 01:04
change file encoding to utf8-lf
#!/bin/bash
if [ $# -gt 2 -o $# -lt 1 ]; then
echo "Usage: $0 TARGET_FOLDER_PATH [TARGET_FILE_REGEX]"
exit 1
fi
TARGET_FOLDER_PATH=$1
if [ $# -eq 1 ]; then
@ecormaksin
ecormaksin / gist:336a687667a76b7c0ba9fa5d08e0567c
Created March 17, 2023 06:56
T-SQL SQL Serverでテーブル定義を取得するクエリ
-- https://learn.microsoft.com/ja-jp/sql/relational-databases/tables/view-the-table-definition?view=sql-server-ver16#TsqlProcedure
SELECT
s.name AS schema_name
, t.name AS table_name
, c.*
, st.name AS [システム型]
, ut.name AS [ユーザー定義型]
FROM
sys.columns AS c
INNER JOIN sys.tables AS t ON
@ecormaksin
ecormaksin / gist:97773ad298aae745b2444c9d3952db98
Created January 31, 2023 02:31
cmderのプロンプト文字を変更する
# %USERPROFILE%\scoop\apps\cmder\current\config\cmder_prompt_config.lua
# 22行目
prompt_lambSymbol = "$"
@ecormaksin
ecormaksin / add_local_bin_to_path.sh
Created January 1, 2023 11:53
add .local/bin to $PATH
LOCAL_BIN_DIR=$HOME/.local/bin
echo $PATH | grep $LOCAL_BIN_DIR >/dev/null
if [ $? -ne 0 ]; then
export PATH=$LOCAL_BIN_DIR:$PATH
fi
@ecormaksin
ecormaksin / gist:1caca89d4f1010500a2039e744fda670
Created October 22, 2022 07:06
change ghq root and set git global user
mkdir -p ~/ws/ghq
git config --global ghq.root '~/ws/ghq'