Skip to content

Instantly share code, notes, and snippets.

View tomoh1r's full-sized avatar
💭
I may be slow to respond.

NAKAMURA, Tomohiro tomoh1r

💭
I may be slow to respond.
View GitHub Profile
@tomoh1r
tomoh1r / README.rst
Last active May 25, 2022 11:59
gofmt のインデント、ハードタブが規定なのはここらあたりかな

新シンタックスはとりあえずどうでもよいので考えない。

2009年の changeset なので、今とオプションが異なる場合があるので注意。

(「This will make the code alignment insensitive to an editor's tabwidth.」の訳は自信ない。)

$ hg clone -u release https://code.google.com/p/go
$ cd go/
@tomoh1r
tomoh1r / README.md
Created March 22, 2020 00:12
Windows Terminal

C:\Users\USERNAME\AppData\Local\Packages\Microsoft.WindowsTerminal_rnd\LocalState\profiles.json

"profiles": {
    "defaults": {
        "fontFace": "Migu 1M",
        "fontSize": 11
    },
    "list": [
 ...
@tomoh1r
tomoh1r / DeleteUTF8Bom.vbs
Created January 14, 2012 15:43
UTF-8 の BOM を削除する VBScript
Option Explicit
' ==================================================================================
' UTF-8 のファイルのBOMを削除するVBScript
' ファイルをドラッグ&ドロップして利用する。
' 2012/01/14 Nakamura, Tomohiro
' This Software is under CC0
' ADODB の為、要Excel
' ==================================================================================
Dim adTypeBinary, adTypeText, adSaveCreateOverWrite
@tomoh1r
tomoh1r / README.md
Created December 11, 2016 04:32
Fluentd + Elasticsearch + Kibana and send local journald logs.

ex-fek

Fluentd + Elasticsearch + Kibana

and send local journald logs.

$ sudo dnf install docker docker-compose
$ docker-compose build
@tomoh1r
tomoh1r / hoge.rst
Last active January 4, 2016 02:19
「或るファイルが修正された或るリビジョンの「次や前に」修正されたリビジョン」を機械的にとる

或るファイルが修正された或るリビジョンの次のリビジョン:

hg log --rev "min(modifies('</target/file/path>') and <target_change_set>: and ! <target_change_set>)"

或るファイルが修正された或るリビジョンの前のリビジョン:

hg log --rev "max(modifies('</target/file/path>') and :$<target_change_set>~1)"
@tomoh1r
tomoh1r / docker-killall.sh
Last active January 1, 2016 02:09
docker の稼働中の container 全て落とす関数
docker_killall() {
# 処理が進んでいる container の id を取得
_get_ids() { docker ps | awk 'NR != 1 { print $1 }' ; }
# 処理中の conatainer の数を取得
_ps_count=$(_get_ids | wc -l)
# 処理中の container が有れば、全て落とす
if [[ $_ps_count != 0 ]] ; then
_get_ids | xargs docker kill
@tomoh1r
tomoh1r / find_in_set.sql
Last active December 30, 2015 07:49
FIND_IN_SET 便利っぽい
mysql> STATUS
--------------
mysql Ver 14.14 Distrib 5.5.27, for Linux (x86_64) using readline 5.1
Connection id: 1
Current database: hogefugapiyo
Current user: spamspamspam@localhost
SSL: Not in use
Current pager: /usr/bin/less
Using outfile: ''
@tomoh1r
tomoh1r / matome.rst
Last active December 29, 2015 03:09
FreeBSD

FreeBSD

目次

FreeBSD

@tomoh1r
tomoh1r / index.html
Last active December 25, 2015 03:51
angular simple example
<!doctype html>
<html lang="en" ng-app="front">
<head>
<meta charset="utf-8">
<title>angular simple example</title>
</head>
<body>
<!-- update this div -->
<div ng-view></div>
@tomoh1r
tomoh1r / some.js
Created December 21, 2015 14:04
ES5 のオブジェクトテスト
> function Some() { this.say = say; return this; function say(msg) { console.log(msg); } }
undefined
> Some().say('あいうえお');
あいうえお
undefined