Skip to content

Instantly share code, notes, and snippets.

View AWtnb's full-sized avatar
i love coffee

AWtnb AWtnb

i love coffee
View GitHub Profile
@AWtnb
AWtnb / otherFuncs.bas
Created January 18, 2019 06:50
excel vba custom functions
' 参照設定 Microsoft VBScript Regular Expressions
' 参照設定 Microsoft Scripting Runtime
Function Variation(myRng As Range) As Long
' 引数内の範囲に何種類のデータが有るかカウント
'連想配列を利用
Dim myDict As New Scripting.Dictionary
Dim cl As Variant
For Each cl In myRng.Cells
If cl.Value <> "" And myDict.Exists(cl.Value) = False Then
@AWtnb
AWtnb / oldFileCleaner.js
Last active February 25, 2019 13:51
delete old file of slack
/*
slack の特定チャンネルで古くなったファイルを自動的に削除する
http://lyncs.hateblo.jp/entry/2017/06/04/191421 を参考に見よう見まねで実装中
*/
// スクリプトのプロパティからトークンの値をグローバル変数として取得
var SLACK_ACCESS_TOKEN = PropertiesService.getScriptProperties().getProperty("TOKEN_PERSONAL");
// チャンネルIDを取得する関数
// mode : public(パブリックチャンネル) or private (プライベートチャンネル)
@AWtnb
AWtnb / exercise_manager.js
Last active March 18, 2019 12:54
manage exercise with slack and google sheet
/*
今日のトレーニングを slack で確認してカレンダーに登録
*/
///////////////////////////////////////////////////////
// グローバル変数
///////////////////////////////////////////////////////
// シート
var SHEET_ID = PropertiesService.getScriptProperties().getProperty("SHEET_ID");
@AWtnb
AWtnb / dataFinder.js
Created March 18, 2019 15:14
get data from google sheet with gas
/*
slack 経由で辞典のデータを参照
*/
/////////////////////////////////////////////
// グローバル変数
/////////////////////////////////////////////
// シート
var SHEET_ID = PropertiesService.getScriptProperties().getProperty("SHEET_ID");
@AWtnb
AWtnb / dummyRobot.js
Last active March 27, 2019 03:31
dummy robot on slack
/*
slash command
言いたいことをロボットに代弁してもらう
scope
chat:write:bot
interactive components
*/
/////////////////////////////////////////////////////////////////////////
// グローバル変数
@AWtnb
AWtnb / emoji2stamp.js
Last active March 28, 2019 03:29
send emoji url with slash command
/*
slash command
投稿された絵文字のURLを返すことでスタンプのように投稿する
*/
/////////////////////////////////////////////////////////////////////////
// グローバル変数
/////////////////////////////////////////////////////////////////////////
// token
@AWtnb
AWtnb / nayose.js
Created May 15, 2019 08:56
nayose on slack
/*
slash command
Microsoft Excel からコピペしたタブ区切りの複数行文字列を名寄せする
*/
// 名寄せ関数
function nayose (str) {
var table = {};
var lines = str.split(/[\r\n]+/g);
// 集約
@AWtnb
AWtnb / wheel_tab_changer_on_chrome.ahk
Created May 21, 2019 04:43
tab changer with Autohotkey
;; Wheel Scroll Tabs for Google Chrome
#If WinActive ("ahk_class Chrome_WidgetWin_1") || WinActive ("ahk_class SUMATRA_PDF_FRAME")
~$WheelUp::
MouseGetPos, x, y
If (y < 45) {
Send, ^+{Tab}
}
else {
@AWtnb
AWtnb / config.yaml
Last active May 21, 2019 05:54
terminus config
hotkeys:
shell:
powershell:
- - Ctrl-T
profile: {}
new-tab: []
close-tab:
- - Ctrl-W
rename-tab: []
split-right: []
@AWtnb
AWtnb / getBookInfo.js
Last active June 2, 2019 13:56
get book information by ISBN
/*
slash command
ISBN から書誌情報を取得する
自社の本であれば5桁のみでマッチ
*/
// ISBN 12桁の末尾にからチェックディジットを追加する関数
function appendCheckDigit (isbn12) {
var array = String(isbn12).split("")
var total = 0;