Skip to content

Instantly share code, notes, and snippets.

View taisyo7333's full-sized avatar

Daisuke Inoue taisyo7333

View GitHub Profile
@taisyo7333
taisyo7333 / .gitconfig
Created August 20, 2015 04:27
SourceTree / git で WinMerge を diff , mergeに使いたい。
[merge]
tool = WinMerge
[mergetool "WinMerge"]
cmd = \"C:/Program Files/WinMerge/WinMergeU.exe\" //e //u //wl //wr \"$LOCAL\" \"$BASE\" \"$REMOTE\" //o \"$MERGED\"
trustExitCode = true
[diff]
guitool = winmerge
[difftool "winmerge"]
path = C:/Program Files/WinMerge/winmergeu.exe
cmd = \"C:/Program Files/WinMerge/winmergeu.exe\" -e -u \"$LOCAL\" \"$REMOTE\"
@taisyo7333
taisyo7333 / timer.h
Last active August 29, 2015 14:28
Win32API SetTimer関数のコールバック関数からメンバ関数をコールしたい。
#pragma once
#include "stdafx.h"
// Reference URL
// https://social.msdn.microsoft.com/Forums/ja-JP/1a0354fc-8e7c-4d75-b65e-6e38041b6e5d/c-how-send-the-class-pointer-with-settimer-function?forum=vclanguage
class Timer
{
public:
Timer()
@taisyo7333
taisyo7333 / vs_build.ps1
Last active August 27, 2015 11:08
Visual Studio -- Build Script by powershell.
$target = 'ソリューション名.sln'
$config = 'Release'
#Rebuild,Build,Clean
$type = 'Rebuild'
$ms_build_path = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319;'
$env:Path = $env:Path + ';' + $ms_build_path
# /m -> concurrent build
#(e.g) MSBuild $target /t:Rebuild /p:Configuration=Release /m
@taisyo7333
taisyo7333 / VS_Build.ps1
Last active August 28, 2015 04:40
VisualStudio BuildScript by powershell
<#
.SYNOPSIS
Build MS project(.sln)
.DESCRIPTION
Build Microsoft Visual Studio project (.sln)
.PARAMETER project
The project file to build.
@taisyo7333
taisyo7333 / timestamp.ps1
Created August 28, 2015 03:46
PowerShell Timestamp
#e.g) 20150828_124340
Get-Date -Format yyyyMMdd_HHmmss
@taisyo7333
taisyo7333 / Tee.ps1
Created August 28, 2015 03:49
PowerShell Tee
# $command : command
# $logfile_path : output file path
Invoke-Expression $command | Tee-Object -FilePath $logfile_path -Append
@taisyo7333
taisyo7333 / Wrote-ErrorLog.ps1
Created August 28, 2015 03:50
powershell : tee error
function Write-ErrorLog {
param( $file_name , $message )
Write-Error $message 2>&1 | Tee-Object -FilePath $file_name -Append
}
@taisyo7333
taisyo7333 / LinqToXml.cs
Last active September 2, 2015 08:39
Get a value of attribute by C# LINQ to XML .
XElement po = XElement.Load(path_xml);
// <Substrates>
// <Substrate SubstrateType = "Strip" SubstrateId = "@@@">
var elems = po.Elements().Descendants()
.Where(node => node.Name.LocalName == "Substrate"
&& (string)node.Attribute("SubstrateType") == "Strip"
&& node.Attribute("SubstrateId") != null
)
.Select(elem => elem.Attribute("SubstrateId").Value);
@taisyo7333
taisyo7333 / Call_XmlValid.cs
Created September 4, 2015 12:34
C# XML Schema 検証
public bool XmlValidTest( string path_xml , string path_schema )
{
using (XmlTester tester = new XmlTester())
{
if( tester.Test(path_schema, path_xml) )
{
return true;
}
}
return false;
@taisyo7333
taisyo7333 / Get-FolderHierarchy.ps1
Created September 10, 2015 15:26
Powershell Recursive
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER base_path
.PARAMETER max_depth
.PARAMETER depth
.EXAMPLE
Get-FolderHierarchy "C:\Windows"
.EXAMPLE