Skip to content

Instantly share code, notes, and snippets.

View nnasaki's full-sized avatar

Masaki Yamamoto nnasaki

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="httpAuthModule" type="System.Configuration.NameValueFileSectionHandler" />
</configSections>
<httpAuthModule>
<!-- If HttpAuthModule has problems, please contact me, https://github.com/nabehiro/HttpAuthModule -->
<!--
[required] Http Authentication Mode.
- Basic: Basic authentication
@nnasaki
nnasaki / chrome-launch-and-capture.js
Last active May 3, 2017 23:37
Chrome Launch And Capture Sample
const CDP = require('chrome-remote-interface');
const fs = require('fs');
const { ChromeLauncher } = require('lighthouse/lighthouse-cli/chrome-launcher');
/**
* Launches a debugging instance of Chrome on port 9222.
* @param {boolean=} headless True (default) to launch Chrome in headless mode.
* Set to false to launch Chrome normally.
* @return {Promise<ChromeLauncher>}
*/
@nnasaki
nnasaki / azure-cli-resource-multiple-delete
Last active March 15, 2019 09:25
Azure CLIでリソースグループを一括削除。一応確認付。
#!/bin/sh
for i in $(az group list | jq -r '.[].name');
do
echo resource group $i include resouces below
az resource list -g $i | jq
echo will delete $i
az group delete --name $i --no-wait
done
@nnasaki
nnasaki / gist:313ce1ffa6dc592a8a45
Created September 6, 2014 07:31
ToDoTableViewController.swift
// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------
//
// 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
@nnasaki
nnasaki / Microsoft.WindowsAzure.Management can't running Azure Web Sites
Last active August 29, 2015 14:01
Microsoft.WindowsAzure.Management Library を Azure Web Siteで動かそうとしたら、動きませんでした。
エラーメッセージ
System.Security.Cryptography.CryptographicException はユーザー コードによってハンドルされませんでした。
HResult=-2147024894
Message=The system cannot find the file specified.
Source=mscorlib
StackTrace:
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
@nnasaki
nnasaki / Microsoft.WindowsAzure.Management raise System.IO.FileNotFoundException
Last active August 29, 2015 14:01
Microsoft.WindowsAzure.Management raise System.IO.FileNotFoundException
型 'System.IO.FileNotFoundException' のハンドルされていない例外が azuremanagement.exe で発生しました
追加情報:ファイルまたはアセンブリ 'Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'、またはその依存関係の 1 つが読み込めませんでした。指定されたファイルが見つかりません。
@nnasaki
nnasaki / convert.rb
Created February 3, 2013 15:55
CSV を変換する例。以下のように実行する。 ruby convert.rb blog.csv > convert.csv
# coding: UTF-8
require "csv"
options = {:headers => true,
:return_headers => true, :write_headers => true}
delete_columns = %w{Path FileName}
CSV.filter(options) do |row|
if row.header_row?
@nnasaki
nnasaki / FizzBuzzTest.cs
Created December 4, 2012 21:24
FizzBuzz の MSTest によるパラメタライズテスト
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FizzBuzzTest
{
[TestClass]
public class FizzBuzzTest
{
public TestContext TestContext { get; set; }
@nnasaki
nnasaki / FizzBuzz.cs
Created December 3, 2012 16:12
FizzBuzz 実装クラス
using System.Globalization;
namespace FizzBuzz
{
public class FizzBuzz
{
private readonly int _inputNumber;
/// <summary>
/// コンストラクタ
@nnasaki
nnasaki / 入力値によってFizzBuzzの文字列を返すことが出来るSteps.cs
Created December 3, 2012 16:01
入力値によってFizzBuzzの文字列を返すことが出来るSteps
using System.Diagnostics;
using System.Globalization;
using TechTalk.SpecFlow;
using TechTalk.SpecFlow.Assist;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FizzBuzz.Specs
{
public class Decision
{