Skip to content

Instantly share code, notes, and snippets.

View callmekohei's full-sized avatar

callmekohei callmekohei

  • Fukuoka / Japan
View GitHub Profile
@asufana
asufana / OSXでのFSharp環境整備.md
Last active July 6, 2016 15:36
OSXでのF#(FSharp)環境整備

OSX での F# (FSharp) 環境整備

環境情報

  • Mac OSX El Capitan 10.11.1
  • mono 4.2.1

mono インストール

//================================================================================
// 共通
//================================================================================
type EmailAddress =
{ EAValue: string }
type SurfaceAddress =
{ SAValue: string }
type Customer =
@kumatti1
kumatti1 / Module1.bas
Last active June 22, 2019 08:56
マウスカーソル直下の要素を取得
'目的の要素を選択
Sub Main()
Application.OnTime Now + TimeSerial(0, 0, 2), "GetSub"
End Sub

テキストプロパティ触ってみた

2019-03-11 gorilla.vim #2

@yu-tang
yu-tang / gist:953997
Created May 3, 2011 19:13
ADODB のインメモリ レコードセットを Access 非連結フォームのレコードソースにセットする
' ADODB のインメモリ レコードセットを Access 非連結フォームのレコードソースに
' セットするサンプル コード。
' 下記をコピペでテストする場合は、運送会社テーブルから表形式フォームをオート
' フォームで作成して、フォームのレコードソース プロパティを削除すると多少楽。
Option Compare Database
Option Explicit
Private Sub Form_Load()
' インメモリ レコードセットをフォームのレコードソースにセットします。
@rf0444
rf0444 / HelloExcelSplit.fs
Last active August 18, 2019 09:22
エクセルのシートに記入されたリストを分割するのを ExcelDNA & F# でやってみるやつ
module HelloExcelSplit
open ExcelDna.Integration
let splitIndex (group: int) (total: int): seq<seq<int>> =
let d = total / group
let m = total % group
let counts = seq { for i in 0 .. group - 1 do yield d + if i < m then 1 else 0 }
let (_, xs) = Seq.fold (fun (a, xs) x -> (a + x, Seq.append xs (Seq.singleton (seq { a .. a + x - 1 })))) (0, Seq.empty) counts
xs
@kos59125
kos59125 / kansuuji.R
Last active January 15, 2020 20:44
漢数字を数値に変換する
kansuuji <- function(x) {
# 漢字から数値へのマッピング
# 万未満の位
map_low <- c(
〇 = 0, 一 = 1, 二 = 2, 三 = 3, 四 = 4,
五 = 5, 六 = 6, 七 = 7, 八 = 8, 九 = 9,
十 = 10, 百 = 100, 千 = 1000
)
# 万以上の位
map_up <- c(
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
一定要用系统自带的 python, 用 brew 或其他方式安装的 python 不能识别 AppKit 等模块,花了很长时间在 pyobjc 的文档中看到这样一句话:
The system version of Python (``/usr/bin/python``) includes a copy of
PyObjC starting at MacOSX 10.5 ("Leopard"). Installing other versions
@yu-tang
yu-tang / IConstructor.cls
Created March 9, 2012 06:33
Constructor for VBA class module.
Option Explicit
Public Sub Initialize(args() As Variant)
'
End Sub
@juanpabloaj
juanpabloaj / AdjustWindowHeight.vim
Last active September 21, 2020 22:24
Automatically fitting a quickfix window height, consider a long line as many lines. based in http://vim.wikia.com/wiki/Automatically_fitting_a_quickfix_window_height
au FileType qf call AdjustWindowHeight(3, 10)
function! AdjustWindowHeight(minheight, maxheight)
let l = 1
let n_lines = 0
let w_width = winwidth(0)
while l <= line('$')
" number to float for division
let l_len = strlen(getline(l)) + 0.0
let line_width = l_len/w_width
let n_lines += float2nr(ceil(line_width))