Skip to content

Instantly share code, notes, and snippets.

@kencoba
kencoba / Vagrantfile
Created August 6, 2020 00:32
Vagrantfile for Jenkins.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
# for Jenkins 8080 -> 8090
config.vm.network "forwarded_port", guest: 8080, host: 8090, host_ip: "127.0.0.1"
config.vm.network "private_network", ip: "192.168.33.12"
@kencoba
kencoba / Vagrantfile
Created August 5, 2020 09:44
Vagrantfile for Docker.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
config.vm.network "private_network", ip: "192.168.33.11"
@kencoba
kencoba / データ抽出.vbs
Created May 18, 2020 09:16
Data extraction from from multiple excel books.
Option Explicit
' | | | |cell_name1|cell_name2|...
' |directory_name|book_name|sheet_name|
'
Public Sub データ抽出()
Dim ブック_オリジナル As Workbook: Set ブック_オリジナル = ThisWorkbook
Dim シート_オリジナル As Worksheet: Set シート_オリジナル = ブック_オリジナル.Sheets(1)
@kencoba
kencoba / ReadDataFromWorkbookWithPasswd.vba
Created January 13, 2020 04:12
Open workbooks in the "path" with "passwd", and read data.
Public Sub パスワード付きファイルを開く()
Dim path As String
With Application.FileDialog(msoFileDialogFolderPicker)
If .Show = True Then
path = .SelectedItems(1)
End If
End With
Dim passwd As String
passwd = InputBox("読み取りパスワード", "読み取りパスワード", "")
@kencoba
kencoba / MultiRowsIntoOne.vb
Created December 6, 2019 02:44
ExcelVBA:Transform data from multible rows into one.
Option Explicit
Public Sub 複数行を単一行へ変換()
Dim 入力シート As Worksheet
Dim 出力シート As Worksheet
Dim 入力行 As Integer ' 入力シートのキーの行番号
Dim 入力列 As Integer ' 入力シートの値の列番号
Dim 出力行 As Integer ' 出力シートの出力行番号
Dim 出力列 As Integer ' 出力シートの出力列番号
Dim 値列数 As Integer ' 値の列数
@kencoba
kencoba / tt.py
Created April 3, 2019 05:42
Touch Typing with Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time
import random
def interval():
start_time = time.time()
def end_time():
return time.time() - start_time
return end_time
@kencoba
kencoba / tt.rb
Created April 2, 2019 08:47
Touch Typing with Ruby
# tt.rb
def interval ()
start_time = (Time.now.to_f * 1000).to_i
lambda {
end_time = (Time.now.to_f * 1000).to_i
end_time - start_time
}
end
@kencoba
kencoba / magic-hexagram.scm
Created July 30, 2017 12:01
Magic hexagram
(use util.combinations)
(use gauche.collection)
; Magic hexagram
;
; a
; / \
; b---c---d---e
; \ / \ /
; f g
@kencoba
kencoba / toolchains.xml
Created July 7, 2017 01:56
.m2/toolchains.xml for java-8-oracle on Ubuntu 16.04. H2Database's pom.xml needs this setting.
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.6</version>
<vendor>sun</vendor>
</provides>
<configuration>
@kencoba
kencoba / .zshrc
Created July 4, 2017 00:14
Moving a word with Ctrl+Arrow.
bindkey '^[[C' forward-word
bindkey '^[[D' backward-word