Skip to content

Instantly share code, notes, and snippets.

View udawtr's full-sized avatar

Wataru Uda udawtr

View GitHub Profile
@udawtr
udawtr / GoogleAnalyticsApi.cs
Created June 25, 2018 00:40 — forked from 0liver/GoogleAnalyticsApi.cs
C# wrapper around the Google Analytics Measurement Protocol API
/* based on the docs at: https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide */
/*
* LICENSE: MIT
* AUTOHR: oliver@teamaton.com
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@udawtr
udawtr / AzureCloudPublisher.psm1
Last active January 1, 2016 10:29
このPowerShellスクリプトモジュールは、WindowsAzureクラウドサービスへデプロイするための機能を提供します。ステージングが空であれば、新規デプロイを行い。そうでなければ、更新デプロイを行います。デプロイ処理中に *.cscfgファイル内の接続文字列を書き変えてプロダクションとステージングで同じ接続文字列を使うことを回避します。例えば、MyConnectionStringという名前で接続文字列を*.cscfgに定義しているとして、そこに使用するストレージアカウントがstorage1またはstorage2であるなら、自動的にプロダクションと衝突しないほうのストレージアカウントを選んで更新します。This PS Script Module provide the funct…
function Publish-AzureCloud
{
param(
[Parameter(Mandatory=$true)]
[string]
$ServiceName,
[Parameter(Mandatory=$true)]
[string]
$SubscriptionId,
@udawtr
udawtr / runnuget.cmd
Created December 24, 2013 02:02
ソリューションフォルダ以下のすべてのプロジェクトのNuGetパッケージを再インストールします。 Clean install NuGet packages of all projects of a solution folder.
@setlocal
@echo off
REM *************** 設定 ***************
set PACKAGE_DIR=packages
REM *************** Resolve the path of NuGet.exe ***************
set NUGET_PATH1="C:\Program Files (x86)\NuGet\NuGet.exe"
set NUGET_PATH2="C:\Program Files\NuGet\NuGet.exe"
@udawtr
udawtr / bootstrap-scrollspy-custom.js
Created December 19, 2013 01:06
boostrapのscrollspyはとてもクールなんだけど、target id を変更できないのでできるようにした。 Bootstrap's scroospy is very cool. But it can't change the target id after initializing. This custom edition can do that. Usage: $('body').data('scrollspy').options.target = navbarId; $('body').scrollspy('rebind');
/* =============================================================
* bootstrap-scrollspy.js v2.0.2
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* 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
*
@udawtr
udawtr / excelqc.bas
Created December 11, 2013 09:37
Excelファイルを公開する際に保護とロックを忘れないように確認します。
Public Sub Test()
Debug.Print "***********************"
Debug.Print "Excel品質チェックツール"
Debug.Print "***********************"
Dim wb As Workbook
For Each wb In Workbooks
If Not wb Is ActiveWorkbook Then
@udawtr
udawtr / wget.vbs
Last active March 23, 2023 04:47
wget.vbs - similar to wget but written in vbscript
'wget.vbs - similar to wget but written in vbscript
'based on a script by Chrissy LeMaire
' Usage
if WScript.Arguments.Count < 1 then
MsgBox "Usage: wget.vbs <url> (file)"
WScript.Quit
end if
' Arguments
@udawtr
udawtr / gist:2021758
Created March 12, 2012 13:07
NUnit MSTest Compatibility import statements
// Unit Testing Imports
#if !NUNIT
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using ClassInitialize = NUnit.Framework.TestFixtureSetUpAttribute;
using ClassCleanup = NUnit.Framework.TestFixtureTearDownAttribute;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
@udawtr
udawtr / gist:2005793
Created March 9, 2012 09:16
default .gitignore for Visual Studio developer
#OS junk files
[Th]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
@udawtr
udawtr / C deserialization.cs
Created March 5, 2012 01:19 — forked from ivasilov/C deserialization.cs
XML serialization
public Person Deserialize(string file)
{
XmlSerializer serializer = new XmlSerializer(typeof(Person));
Stream reader = new FileStream("C:\\myXmFile.xml", FileMode.Open);
Person temp=(Person)serializer.Deserialize(reader);
reader.Close();
return temp;
}