WIP某所で喋るための草稿。
当たり前のことを書く。当たり前のことが、当たり前にできない人へ。JavaScriptだから、当たり前のことをしなくていいと思っている人達へ。
- それぞれのファイルは、可能な限り参照透過な関数を提供する
- それぞれのファイルは、読み込んだだけでは副作用を起こさない
| @echo off | |
| chdir %* | |
| set BRANCH= | |
| for /f "eol=; tokens=1,2 delims== " %%i in ('"git branch 2>NUL"') do if "%%i"=="*" set BRANCH=%%j | |
| if "%BRANCH%" neq "" ( | |
| set PROMPT=$P^(%BRANCH%^)$G | |
| ) else ( | |
| set PROMPT=$P$G | |
| ) |
| import { browserHistory } from 'react-router'; | |
| /** | |
| * @param {Object} query | |
| */ | |
| export const addQuery = (query) => { | |
| const location = Object.assign({}, browserHistory.getCurrentLocation()); | |
| Object.assign(location.query, query); | |
| browserHistory.push(location); | |
| }; |
この記事は Scala Advent Calendar 2016(Adventar) 10日目の記事です。
今は 12/10 の 625時です。年明けなんて無かった。いいね?
さてさて、sbt の依存jarのダウンロードが遅い、というのは割とよく言われる事であります。
で、この原因の一旦に、sbtが Apache Ivy を使っている、という点があります。
| var wshell = new ActiveXObject('WScript.Shell'); | |
| var fso = new ActiveXObject( 'Scripting.FileSystemObject'); | |
| var archivePath = WScript.arguments(0); | |
| var dirPath = wshell.currentDirectory + '/' + fso.getBaseName(archivePath); | |
| var process = wshell.Exec('"C:/Program Files/7-zip/7zG.exe" x "' + archivePath + '" -aou -spe -o"' + dirPath + '"'); | |
| while (process.status !== 1) { | |
| WScript.sleep(10); | |
| } |
| function! s:fold(list, init, pred) abort | |
| let acc = a:init | |
| for item in a:list | |
| let acc = a:pred(acc, item) | |
| endfor | |
| return acc | |
| endfunction | |
| echo s:fold([1, 2, 3, 4, 5], 0, {acc, i -> acc + i}) |
| " | |
| " usage: :Vimgrep /foo/ ** | |
| " | |
| function! s:exit_handler(id) dict abort | |
| execute 'cfile' self.tempfile | |
| copen | |
| endfunction | |
| function! s:vimgrep(args) abort |
| @@ -441,7 +443,15 @@ noremap gm m | |
| "Esc->Escで検索結果とエラーハイライトをクリア | |
| nnoremap <silent><Esc><Esc> :<C-u>nohlsearch<CR> | |
| "{数値}<Tab>でその行へ移動.それ以外だと通常の<Tab>の動きに | |
| -noremap <expr><Tab> v:count != 0 ? "G" : "\<Tab>zvzz" | |
| +function! s:go_to_line(lnum) abort | |
| + set number | |
| + augroup vimrc-go-to-line | |
| + autocmd! | |
| + autocmd InsertEnter,CursorHold * set nonumber | autocmd! vimrc-go-to-line |
| /* MIT License | |
| * | |
| * Copyright (c) 2017 Roland Singer [[email protected]] | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |