Skip to content

Instantly share code, notes, and snippets.

View okhiroyuki's full-sized avatar

Hiroyuki Okada okhiroyuki

View GitHub Profile
@okhiroyuki
okhiroyuki / ImportCSVtoExcel.rb
Created March 31, 2010 01:14
Import CSV Data to Excel
#! ruby -Ks
require "exlap"
filename2 = "template.xls"
path = "./hoge"
a_path = Dir.entries(path)
xl = Exlap.new
@okhiroyuki
okhiroyuki / AllPrintExcel.rb
Created March 31, 2010 01:19
The file of all the Excel that exists in a certain folder is printed.
#! ruby -Ks
require 'win32ole'
xl = WIN32OLE.new('Excel.Application')
xl.DisplayAlerts = false
xl.Visible = true
# フォルダ名を指定
foldername = "buf"
@okhiroyuki
okhiroyuki / AutoPatchWork
Created May 28, 2010 01:59
windows chrome setting
.autopagerize_page_separator_blocks .autopagerize_link:before{
content:"page: " attr(number);
}
.autopagerize_page_separator_blocks .autopagerize_link:hover:before{
content:"";
}
.autopagerize_page_separator_blocks .autopagerize_link:hover:after{
content:attr(href);
}
.autopagerize_page_separator{
@okhiroyuki
okhiroyuki / nettime.bat
Created May 28, 2010 02:03
基準となるローカルパソコンの時間と同期させる
net time \\***.***.***.*** /set /yes
@okhiroyuki
okhiroyuki / battery_check.vbs
Created May 28, 2010 02:09
Windows PC の電源供給状況をメール監視
Dim b_bool
Dim oMsg
Dim filename
Dim strNum
Dim message
strComputer = "."
filename = "status.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
@okhiroyuki
okhiroyuki / gist:810675
Created February 4, 2011 03:03
EXCELのグラフで指定している参照先を一括変換する
Sub ReplaceGraphFormula()
'
' グラフ参照先一括変換
'
Dim hoge As String
Dim gnum, str1, str2 As String
str1 = "L10" 'ターゲットの文字列
str2 = "L5" '置換後の文字列
@okhiroyuki
okhiroyuki / gist:950982
Created May 1, 2011 23:20
Chrome Keyconfig
{
"name": "Chrome Keyconfig",
"version": "1.11.0",
"normal_actions": {
"j": {
"name": "scroll down",
"args": []
},
"k": {
"name": "scroll up",
@okhiroyuki
okhiroyuki / ConnectRails.ino
Created June 21, 2011 10:21
xbee経由で受けとった温度データをarduinoが読みとり、Railsに上げる
#include <Ethernet.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
byte mac[] = { 0x00, 0x50, 0xC2, 0x97, 0x21, 0xBD };
byte ip[] = { 192, 168, 0, 112 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
byte server[] = { 192, 168, 0, 111 };
@okhiroyuki
okhiroyuki / HatenaDialy.scpt
Created December 10, 2011 00:02
Send Mail HatenaDialy From MarsEdit
set myfrom to "****@example.com" -- 自分のメールアドレス
set hatenato to "****@d.hatena.ne.jp" -- 送信先メールアドレス
tell application "MarsEdit"
tell document 1
set tit to get title
set cont to get body
set cont to cont & (get extended entry)
end tell
end tell
@okhiroyuki
okhiroyuki / gist:3021682
Created June 30, 2012 01:23
Setting RTC on mbed from GPS(GT-720F)
#include "mbed.h"
#include "TinyGPS.h"
TinyGPS gps;
Serial pc(USBTX, USBRX); // tx, rx
Serial device(p9, p10); // tx, rx
int main() {
struct tm t;