Skip to content

Instantly share code, notes, and snippets.

@hkuno9000
hkuno9000 / git-diff-excel.md
Last active December 30, 2023 13:47
How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

How to git diff for MS-Excel files(xls/xlsx) on Windows-OS

  1. Download the xdoc2txt tool from: http://ebstudio.info/home/xdoc2txt.html#download
  2. extract "xdoc2txt.exe" and locate it on your PATH folder
  3. edit your gitattributes as A:
  4. edit your gitconfig as B:

A: append following texts to "~/.config/git/attributes" or ".git/info/attributes"

*.xls	diff=xdoc2txt
@hkuno9000
hkuno9000 / file-sharemode.md
Last active December 22, 2022 18:18
CheetSheet file share mode

Win32/ATL

<WinNT.h>
#define FILE_SHARE_READ                 0x00000001
#define FILE_SHARE_WRITE                0x00000002
#define FILE_SHARE_DELETE               0x00000004

CreateFile(filename, access, sharemode, creation, attributes, ...);
CAtlFile::Open(filename, access, sharemode, creation, attributes, ...);
@hkuno9000
hkuno9000 / git-rebase-onto.md
Last active October 14, 2022 05:20
git reabse --onto の動作解説

git rebase --onto の動作解説

https://git-scm.com/docs/git-rebase に記載されている説明を、厳密な正確性よりも分かりやすさを優先して書き換えたものです。 git reabse の使い方に悩む方々の参考になればと思い公開します。

コマンドライン

git rebase [--onto 接続先] 上流ブランチ [対象ブランチ]

引数解説

  • 対象ブランチ: 省略時はカレントのブランチが対象となる。
@hkuno9000
hkuno9000 / doskey.mac
Last active September 11, 2022 18:37
my aliases on windows cmd shell + cygwin
alias=doskey /macros
a=doskey /macros
h=doskey /history
l=dir /b $*
ziplist=unzip -l $*
7zlist=7z l $*
patchzip=perl -n -e "print if s/^Index: //;" patch.diff | zip patch.zip -@
..=pushd ..\$*
...=pushd ..\..\$*
....=pushd ..\..\..\$*
// wrapper functions to fix C4996 on VS2019
//#include <string.h>
//#include <stdlib.h>
//#include <stdio.h>
//#include <wchar.h>
//#include <tchar.h>
template <typename T> T* malloc_array(rsize_t size) {
return static_cast<T*>(malloc(sizeof(T) * size));
}
@hkuno9000
hkuno9000 / gitbucket-print-ready.css
Last active May 11, 2021 08:39
GitBucket print ready Bookmarklet and User-defined CSS
/** GitBuckect 4.3x's User-defined CSS にて gitbucket-print-ready.js と同等の印刷結果を得る */
/* コードブロックの背景色とボーダ設定が上書きされているので、さらに上書きする. */
div.markdown-body pre.prettyprint {
border: 1px solid #888!important;
background-color: #f5f5f5;
}
@media print {
/* コードブロックのスクロールバーは印刷時には無意味なので、行折り返しに変更する */
div.markdown-body pre.prettyprint {
@hkuno9000
hkuno9000 / gitconfig
Last active September 30, 2020 07:13
my git alias and difftool/mergetool for WinMerge
# git config --global -e
[core]
autocrlf = true
excludesfile = C:/Users/hkuno/Documents/gitignore_global.txt
quotepath = false
## http://orangeclover.hatenablog.com/entry/20121004/1349353957
## editor = 'C:/Program Files (x86)/Hidemaru/Hidemaru.exe' //fu8
## editor = 'C:/Program Files (x86)/sakura/sakura.exe' -code=4
## editor = 'C:/Program Files (x86)/EmEditor/EmEditor.exe' //cp 65001
## editor = 'C:/Program Files (x86)/TeraPad/TeraPad.exe' //cu8
@hkuno9000
hkuno9000 / MFC detecting MACRO name
Last active January 16, 2019 02:07
How to detect MFC class in import headers
macro name | target
---------------|-------------
_AFX | MFC classes
__CSTRINGT_H__ | CString
__AFXSTR_H__ | MFC's CString
__ATLSTR_H__ | ATL's CString
#include <import.h>
en_US 0x409
ja_JP 0x411
zh_CN 0x804
zh_TW 0x404
ko_KR 0x412
@hkuno9000
hkuno9000 / push-to-multi-mirror-repos.sh
Last active September 13, 2018 00:00
git puth to multi mirror repos.
git clone https://who@github.com/who/proj.git
cd proj
# set remote mirror URL
git remote add --mirror=push mirror1 https://who@bitbucket.org/who/proj.git
git remote add --mirror=push mirror2 https://who@abc.com/who/proj.git
# push to remote-mirrors
git push mirror1
git push mirror2
# push to direct-URL
git push --mirror https://who@xyz.com/who/proj.git