Skip to content

Instantly share code, notes, and snippets.

View smallfield's full-sized avatar

smallfield

  • Copenhagen, Denmark
View GitHub Profile
" auto reload .vimrc"{{{
augroup source-vimrc
autocmd!
autocmd BufWritePost *vimrc source $MYVIMRC | set foldmethod=marker
autocmd BufWritePost *gvimrc if has('gui_running') source $MYGVIMRC
augroup END"}}}
" カラースキームの設定
colorscheme desert
@smallfield
smallfield / .vimrc
Created February 27, 2015 22:49
vimrc
" auto reload .vimrc
augroup source-vimrc
autocmd!
autocmd BufWritePost *vimrc source $MYVIMRC | set foldmethod=marker
autocmd BufWritePost *gvimrc if has('gui_running') source $MYGVIMRC
augroup END
"---タイムスタンプのやつ
inoremap <F5> <ESC>i<C-R>=strftime("%H:%M ")<CR>
inoremap <F6> <ESC>i<C-R>=strftime("%Y/%m/%d (%a)")<CR><CR>
@smallfield
smallfield / netcall.rb
Last active August 29, 2015 14:14
野村Net&Callで投資信託毎の投資来利益をTSVで出力する
require "mechanize"
ID=""
PASSWD=""
agt = Mechanize.new
agt.user_agent_alias = "Windows IE 9"
page = agt.get("https://netcall.nomura.co.jp/oms")
form = page.forms[0]
form.user_id = ID
form.user_password = PASSWD
@smallfield
smallfield / iijmio.sh
Last active August 29, 2015 14:08
IIJmioのデータ通信残量を表示するMuninプラグイン
#!/bin/sh
# SETTING HERE
mio_id=hoge
mio_pass=fuga
if [ $1 = "config" ]
then
cat <<'EOM'
graph_title IIJmio
SELECT channels.title, videos.title, filename
FROM `videos`
JOIN channels ON videos.channelid = channels.id
WHERE filename IS NOT NULL
@smallfield
smallfield / netcall.rb
Created September 30, 2014 15:01
野村ネット&コールの評価損益取得
require "mechanize"
ID=""
PASSWD=""
agt = Mechanize.new
agt.user_agent_alias = 'Windows IE 9'
page = agt.get("https://netcall.nomura.co.jp/oms")
form = page.forms[0]
form.user_id = ID
form.user_password = PASSWD
page = agt.submit(form)
#!c:/bin/ruby/bin/ruby
# -*- encoding: cp932 -*-
# file: tsv2sqlite3.rb
require 'optparse'
require 'rubygems'
require 'sqlite3'
opt = OptionParser.new
@smallfield
smallfield / workout.html
Last active January 3, 2016 16:19
workout visualize sample
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My workout stat</title>
<script src="//code.jquery.com/jquery-1.8.2.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script type='text/javascript' src='//www.google.com/jsapi'></script>
@smallfield
smallfield / wahootsv.awk
Last active January 7, 2024 14:55
Extract general information from Wahoo workout data(CSV).
#usage
# find %Dropbox%/Apps/Wahoo | grep csv$ | sort | awk -f wahoo2csv.awk
# Date, TotalDistance, Time, AverageSpeed
BEGIN {
FS=","
general_info_flg=0
distance=0
}
@smallfield
smallfield / productkey.js
Created November 28, 2013 01:54
Windowsのプロダクトキーを調べるJScript。
function windows_productkey(){
WshShell = new ActiveXObject( "WScript.Shell" );
ret = WshShell.RegRead('HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\DigitalProductId');
DigitalProductId = ret.toArray();
hexPid = DigitalProductId.slice( 52, 67 );
decodedChars = Array(24);
digits = Array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9");
for ( var i=1; i<30;i++ ){
if((i % 6) == 0 ){
decodedChars.push("-");