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 / wslu-alias.sh
Last active June 14, 2020 02:21
wslu alias for zsh
for c in wslfetch wslpath wslsys wslupath wslusc wslvar wslview
do
alias $c="PATH=$PATH:/mnt/c/windows/system32 $c"
done
alias open=wslview
@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
if ($host.Name -eq 'ConsoleHost')
{
if(-not (Get-Module PSReadline))
{
Install-Package PSReadline -Force
}
Import-Module PSReadline
Set-PSReadlineOption -EditMode Emacs
Set-PSReadlineKeyHandler -Key Ctrl+R -Function HistorySearchBackward
@takekazuomi
takekazuomi / PSCloudShellStartup.ps1
Created October 9, 2017 00:35
Startupscript for PowerShell Cloud Shell 2017/10/09
# Startupscript for PowerShell Cloud Shell
# User profile script location
$script:CurrentHostProfilePath = (Join-Path $env:USERPROFILE 'CloudDrive\Microsoft.PowerShell_profile.ps1')
$script:AllHostsProfilePath = (Join-Path $env:USERPROFILE 'CloudDrive\profile.ps1')
$script:AzureRMProfileModule = 'AzureRM.Profile'
if ($PSVersionTable.PSEdition -eq 'Core')
{
$script:AzureRMProfileModule = 'AzureRM.Profile.NetCore'