Skip to content

Instantly share code, notes, and snippets.

View takekazuomi's full-sized avatar
:octocat:
on code

Takekazu Omi takekazuomi

:octocat:
on code
View GitHub Profile
@takekazuomi
takekazuomi / createUserInvitation.sh
Last active June 12, 2020 05:40
create user invitation for Azure Static Web Apps
#!/bin/bash
SUBSCRIPTION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
RESOURCE_GROUP_NAME=foobar-rg
STATIC_SITE_NAME=foobar-swa
DOMAIN=purple-apple-0611x5701.azurestaticapps.net
USER_DETAILS=foobar@costoco.com
cat << EOJ > properties.json
{
C:\Windows\Fonts\BIZ-UDGothicB.ttc, BIZ UDゴシック, Bold, 0.5, PreviewAndPrint
C:\Windows\Fonts\BIZ-UDGothicR.ttc, BIZ UDゴシック, Regular, 0.5, PreviewAndPrint
C:\Windows\Fonts\BIZ-UDMinchoM.ttc, BIZ UD明朝, Medium, 0.5, PreviewAndPrint
C:\Windows\Fonts\HGRGE.TTC, HGゴシックE, 標準, 0.5, Editable
C:\Windows\Fonts\HGRGM.TTC, HGゴシックM, メディウム, 0.5, Editable
C:\Windows\Fonts\HGRGY.TTC, HG行書体, メディウム, 0.5, Editable
C:\Windows\Fonts\HGRKK.TTC, HG教科書体, メディウム, 0.5, Editable
C:\Windows\Fonts\HGRMB.TTC, HG明朝B, ボールド, 0.5, Editable
C:\Windows\Fonts\HGRME.TTC, HG明朝E, 標準, 0.5, Editable
@takekazuomi
takekazuomi / list-oledb.ps1
Created December 3, 2019 00:51
list installed oledb provider
# https://stackoverflow.com/a/32247214/910906
(New-Object System.Data.OleDB.OleDBEnumerator).GetElements() | Select-Object SOURCES_NAME, SOURCES_DESCRIPTION
@takekazuomi
takekazuomi / styles.xml
Created October 31, 2019 07:23
元号表示のときに使われるformat code
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr"
xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main"
xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision">
<numFmts count="2">
<numFmt numFmtId="178" formatCode="[$-411]ggge&quot;年&quot;m&quot;月&quot;d&quot;日&quot;;@"/>
<numFmt numFmtId="179" formatCode="[$]ggge&quot;年&quot;m&quot;月&quot;d&quot;日&quot;;@" x16r2:formatCode16="[$-ja-JP-x-gannen]ggge&quot;年&quot;m&quot;月&quot;d&quot;日&quot;;@"/>
</numFmts>
using System;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
// Azure Storage Blobs client library for .NET
// https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/README.md
// samples
// https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/storage/Azure.Storage.Blobs/samples
namespace blob
dotnet publish --nologo -c Release -r win10-x64 --self-contained=false /p:PublishSingleFile=true /p:PublishTrimmed=false /p:PublishReadyToRun=false -o work1
dotnet publish --nologo -c Release -r win10-x64 --self-contained=true  /p:PublishSingleFile=true /p:PublishTrimmed=false /p:PublishReadyToRun=false -o work2
dotnet publish --nologo -c Release -r win10-x64 --self-contained=true  /p:PublishSingleFile=true /p:PublishTrimmed=true /p:PublishReadyToRun=false  -o work3
dotnet publish --nologo -c Release -r win10-x64 --self-contained=true  /p:PublishSingleFile=true /p:PublishTrimmed=false /p:PublishReadyToRun=true  -o work4
dotnet publish --nologo -c Release -r win10-x64 --self-contained=true  /p:PublishSingleFile=true /p:PublishTrimmed=true /p:PublishReadyToRun=true   -o work5
# invoke-psake -task Init,Publish
Task default -Depends Publish
Task Init {
dotnet new console -o .\singleexe -n singleexe
}
Task Publish {
cd singleexe
dotnet publish --nologo -c Release -r win10-x64 --self-contained=false /p:PublishSingleFile=true -o work1
@takekazuomi
takekazuomi / GzFileSource.cs
Created March 17, 2019 18:45
IMultiStreamSource for gzipped file
public sealed class GzFileSource : IMultiStreamSource
{
private readonly string[] _paths;
public GzFileSource(params string[] paths)
{
if (paths == null || (paths.Length == 1 && paths[0] == null))
{
_paths = new string[0];
return;
@takekazuomi
takekazuomi / before.txt
Created October 11, 2018 15:44
ksk-rollover log
; <<>> DiG 9.10.3-P4-Debian <<>> @a.root-servers.net. . DNSKEY
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36315
;; flags: qr aa rd; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
--- ./2016-03-01/CommonDefinitions.json.1 2018-09-09 07:07:44.365565300 +0900
+++ ./2018-02-1/CommonDefinitions.json.1 2018-09-09 07:07:52.212100600 +0900
@@ -1,13 +1,19 @@
{
"swagger": "2.0",
"info": {
- "version": "2016-03-01",
+ "version": "2018-02-01",
"title": "Common Definitions"
},