Skip to content

Instantly share code, notes, and snippets.

View TsuyoshiUshio's full-sized avatar
:octocat:
Enjoy coding

Tsuyoshi Ushio TsuyoshiUshio

:octocat:
Enjoy coding
  • Microsoft
  • Kirkland
View GitHub Profile
@TsuyoshiUshio
TsuyoshiUshio / private.env
Created October 28, 2019 00:28
Acceptance Testing for debbuging
DEV_ROOT=/Users/ushio/dev/go
GOPATH=/Users/ushio/dev/go
AZDO_ORG_SERVICE_URL="https://dev.azure.com/<YOUR ORGANIZATION>"
AZDO_PERSONAL_ACCESS_TOKEN="<YOUR_AZDO_PERSONAL_ACCESS_TOKEN>"
AZDO_GITHUB_SERVICE_CONNECTION_PAT="<YOUR_GITHUB_SERVICE_CONNECTION>"
AZDO_TEST_AAD_USER_EMAIL=<YOUR_E_MAILS>
TF_ACC=1
@TsuyoshiUshio
TsuyoshiUshio / launch.json
Last active January 14, 2021 19:27
Acceptance Testing Settings
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Acceptance test",
"type": "go",
"request": "launch",
"mode": "test",
"program": "${workspaceRoot}/azuredevops/resource_project_test.go",
"args": [
@TsuyoshiUshio
TsuyoshiUshio / launch.json
Last active October 28, 2019 00:10
Sample debugging for Acceptance Testing
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Acceptance test",
"type": "go",
"request": "launch",
@TsuyoshiUshio
TsuyoshiUshio / tools.go
Created October 27, 2019 23:33
Dependency version control for Go Module project
// +build tools
package tools
import (
_ "golang.org/x/tools/cmd/stringer"
)
@TsuyoshiUshio
TsuyoshiUshio / .zshrc
Created October 27, 2019 22:57
This is ghq and peco configuration on .zshrc
function peco-src () {
local selected_dir=$(ghq list -p | peco --query "$LBUFFER")
if [ -n "$selected_dir" ]; then
BUFFER="cd ${selected_dir}"
zle accept-line
fi
zle clear-screen
}
zle -N peco-src
bindkey '^]' peco-src
@TsuyoshiUshio
TsuyoshiUshio / Dockerfile
Last active October 3, 2019 07:26
Docker file for user settings sample
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /app
COPY . .
WORKDIR /app/src/Web
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS runtime
@TsuyoshiUshio
TsuyoshiUshio / UnitTest.cs
Created September 8, 2019 19:57
Coolな解答
public class TreeNode
{
public int val;
public TreeNode left;
public TreeNode right;
public TreeNode(int x) { val = x; }
}
static void Main(string[] args)
{
@TsuyoshiUshio
TsuyoshiUshio / UnitTest.cs
Last active September 8, 2019 19:57
Coolではない解答
public class TreeNode
{
public int val;
public TreeNode left;
public TreeNode right;
public TreeNode(int x) { val = x; }
}
@TsuyoshiUshio
TsuyoshiUshio / UnitTest.cs
Created September 6, 2019 19:42
旧アルゴリズム(ちゃんとうごいたもの)
public class Solution
{
private int VisitNode(Queue<Payload> q,
Dictionary<string, Node> nodes,
Dictionary<string, int> visited,
Dictionary<string, int> otherVisited)
{
var payload = q.Dequeue();
foreach(var p in nodes[payload.Word].Relationship)
@TsuyoshiUshio
TsuyoshiUshio / UnitTest.cs
Created September 6, 2019 19:36
Double BFS however, it doesn't work correctly.
using System;
using System.Collections.Generic;
using Xunit;
namespace WordLadder.Test
{
public class Solution
{
private int VisitNode(Queue<Payload> q,