Skip to content

Instantly share code, notes, and snippets.

View kemokemo's full-sized avatar
🎮
ebiten is awesome

kemokemo kemokemo

🎮
ebiten is awesome
View GitHub Profile
@kemokemo
kemokemo / EventLogBinary.vbs
Created December 5, 2016 12:45
This vbscript collects all of the windows event logs in the binary (*.evt) format.
' default path to collect event log.
path = "C:\path\to\eventlog"
' arg0 is path
Dim oParam
set oParam = WScript.Arguments
If oParam.Count > 0 Then
path = oParam(0)
End If
@kemokemo
kemokemo / MsiProperty.vbs
Created January 8, 2017 08:08
Get value of specified property from a msi file.
Option Explicit
''' Main Function
' Arguments
Dim msiPath
Dim propertyName
GetArguments()
' Open database to access msi file's property
Dim installer
@kemokemo
kemokemo / Info.xml
Last active January 13, 2017 17:51
Update a xml file of installer information using "MsiProperty.vbs".
<?xml version="1.0" encoding="UTF-8"?>
<Softwares xmlns="http://t2wonderland.blogspot.jp/ns/softwares">
<Name>Softwares</Name>
<Version>1.0.0</Version>
<SoftwareList>
<SoftwareInfo>
<MsiPath>data/go1.7.3.windows-amd64.msi</MsiPath>
<ProductVersion>1.0.0</ProductVersion>
</SoftwareInfo>
</SoftwareList>
@kemokemo
kemokemo / logging.go
Created July 22, 2017 04:51
logging code sample by golang
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"time"
@kemokemo
kemokemo / mp3sample.go
Last active December 13, 2018 19:34
A modified version of the sample that uses go-mp3 and oto library to play mp3
// Copyright 2017 Hajime Hoshi
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@kemokemo
kemokemo / GetFileNameWithoutExt.go
Last active August 16, 2017 08:34
Go言語でパス情報から拡張子なしのファイル名を取り出したい ref: http://qiita.com/KemoKemo/items/d135ddc93e6f87008521
package main
import (
"fmt"
"path/filepath"
)
func main() {
paths := []string{
filepath.Join("path", "to", "file.name.hoge.name"),
@kemokemo
kemokemo / base.go
Last active April 23, 2018 18:49
golang main snippet
package main
import (
"log"
"os"
)
const (
exitCodeOK int = iota
exitCodeFailed
@kemokemo
kemokemo / file0.txt
Last active September 4, 2017 01:09
Linux形式のパスをWindows形式のパスに変換してクリップボードにコピーする方法 ref: http://qiita.com/KemoKemo/items/f91800836799102cf1f9
# 日本語を含むパスで文字化けします
$ cygpath -w `pwd` | tr -d '\n' | clip
@kemokemo
kemokemo / cd.go
Last active April 25, 2018 12:43
a sample to get the current directory of the executed program.
package main
import (
"log"
"os"
"path/filepath"
)
const (
exitCodeOK int = iota
@kemokemo
kemokemo / build.bat
Last active July 17, 2018 04:18
a script to build golang app for multi-platform.
@echo off
setlocal enabledelayedexpansion
rem set the result of the "git rev-parse --short HEAD" to the variable 'rev'
for /f "usebackq tokens=*" %%a in (`git rev-parse --short HEAD`) do @set rev=%%a
set GOOS=windows
set GOARCH=amd64
go build -ldflags "-X main.Revision=%rev%"
endlocal