Skip to content

Instantly share code, notes, and snippets.

View h1romas4's full-sized avatar
🍕
< Pizza Time

hiromasa h1romas4

🍕
< Pizza Time
View GitHub Profile
@h1romas4
h1romas4 / get_shutdown_log.ps1
Last active December 9, 2017 05:51
Windows のイベントログを元に PC の日ごとの起動終了ログを出力する(日中の再起動は無視)
# 実行日当月のイベントログを対象にする
Get-EventLog -LogName System -After (Get-Date -Format "yyyy/MM/01") | Where-Object {
# OSの起動終了時刻をイベントログサービスの開始(6005)、停止(6006)で判定
$_.EventID -eq '6005' -or $_.EventID -eq '6006'
} | ForEach-Object {
# イベントを日付でサマリーするためのカスタムオブジェクト生成
[PSCustomObject]@{
EventID = $_.EventID
EventName = if($_.EventID -eq '6005') { "up" } else { "down" }
DateGenerated = ($_.TimeGenerated).ToString("yyyy/MM/dd")
@h1romas4
h1romas4 / hex2c.sh
Last active April 16, 2018 14:07
バイナリファイルを hexdump コマンドで C のソースファイル形式に出力
hexdump -v -e '16/1 "0x%02x, " "\n"' 01.vgm > dump.c
@h1romas4
h1romas4 / build.gradle
Last active December 22, 2017 13:09
Visual Studio Code / Eclipse / Intellij Idea 用 Java プロジェクト build.gradle (Spring Loaded 対応)
buildscript {
dependencies {
// for live reloaded
// classpath 'org.springframework:springloaded:1.2.6.RELEASE'
}
}
plugins {
id 'java'
id 'eclipse'
@h1romas4
h1romas4 / tasks.json
Last active December 22, 2017 13:04
VS Code タスク機能で gradle を呼び出す定義
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "gradlew build",
"type": "shell",
"command": "./gradlew build",
"windows": {
@h1romas4
h1romas4 / my-theme.css
Created April 11, 2018 08:23
reveal.js 用の CSS
/*
---
theme: "White"
customTheme: "my-theme"
center: false
---
*/
.reveal {
background-color: #ddd;
@h1romas4
h1romas4 / build.gradle
Created June 12, 2018 07:23
Gradle multi projext example.
/**
* Gradle マルチプロジェクトの例
*
* build/build.gradle
* build/setting.gradle
*
* Application/
* Common/
* Project1/
* Project2/
@h1romas4
h1romas4 / build.gradle
Last active July 29, 2018 09:29
Gradle の Application プラグインで ./gradlew run 実行時に引数を指定する(Gradle 4.9 未満)
apply plugin: 'groovy'
apply plugin: 'application'
mainClassName = 'Hego'
/**
* 起動オプション
*
* Gradle 4.9 なら次で OK
* ./gradlew run --args 'foo --bar'
@h1romas4
h1romas4 / gradlew.bat
Created August 8, 2018 03:19
IBM Java で maven リポジトリの https 接続が connection reset エラーで接続できない場合
rem IBM JDK 1.8.0_171 以上のバージョンを使うこと
rem C:>java -version
rem java version "1.8.0_171"
rem Java(TM) SE Runtime Environment (build 8.0.5.17 - pwa6480sr5fp17-20180627_01(SR5 FP17))
rem IBM J9 VM (build 2.9, JRE 1.8.0 Windows 7 amd64-64-Bit Compressed References 20180626_390413 (JIT enabled, AOT enabled)
rem OpenJ9 - 5cdc604
rem OMR - a24bc01
rem IBM - 21870d6)
rem JCL - 20180619_01 based on Oracle jdk8u171-b11
@h1romas4
h1romas4 / settings.json
Created August 8, 2018 17:28
VS Code のユーザー設定
// 既定の設定を上書きするには、このファイル内に設定を挿入します
{
"editor.fontSize": 15,
"editor.fontFamily": "Ricty, Consolas, 'Courier New', monospace",
"editor.renderIndentGuides": true,
"window.zoomLevel": 0,
"window.menuBarVisibility": "toggle",
"php.suggest.basic": false,
"workbench.iconTheme": "vs-minimal",
"editor.minimap.enabled": false,
@h1romas4
h1romas4 / c_cpp_properties.json
Last active August 12, 2018 08:03
ESP32 用の c_cpp_properties.json 設定
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceRoot}",
"~/esp/esp-idf/components/"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,