- node.js をインストールしておく (Windows ならここからインストーラをダウンロード)
- 作業フォルダ(プロジェクトフォルダ)に移動。
> npm initで作業場所を準備、package.jsonを生成。
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| class Program | |
| { | |
| class 牛めし | |
| { | |
| public string 大きさ { get; set; } | |
| public int カロリー { get; set; } |
| $serverName = "<server name>" | |
| $resourceGroupName = "<resource group name>" | |
| $ruleName = "<rule name>" | |
| $globalIPAddress = curl.exe -s http://inet-ip.info | |
| echo "Global IP Address of this site: $globalIPAddress" | |
| az sql server firewall create --firewall-rule-name $ruleName --server-name $serverName -g $resourceGroupName --start-ip-address $globalIPAddress --end-ip-address $globalIPAddress > $null | |
| az sql server firewall list --server-name $serverName -g $resourceGroupName -o table |
| let code = "f8f8f8f8f7b2f8f63181f8f5c1318131f8f401318101f8f3c10131810131f8f202318102f8f1c10231810231f803718103f7c10211f1e10331f6810271f28103f5e10211f1b1f1e10331f40371c131f28103f3c10211f10131f2e10331f2810271e10131f38103f1e103f1810131f3c10371f1810211e10131f3810211f2e103f18131f2e10331f3810231e131f28103f4e103f1b1f1e10371f5810231f2810211f6e103f1e10331f7810231810211f8e10231810271f8f1810131810111f8f2e10131810131f8f381318111f8f4c1318171f8f53191f8f7b1f8f8f8f8f07" | |
| let decodeIt (code:string) = | |
| let data = | |
| [0..(code.Length/2)-1] | |
| |> Seq.map (fun n -> code.Substring(n*2, 2)) | |
| |> Seq.map (fun s -> new String(s.[0], Convert.ToInt32(string s.[1], 16))) | |
| |> Seq.toArray |> (fun a -> String.Join ("", a)) |
> npm init で作業場所を準備、package.json を生成。| node_modules |
| if exist "$(ProjectDir)custom.appSettings.config" goto SKIP | |
| echo ^<?xml version="1.0" encoding="utf-8" ?^> > "$(ProjectDir)custom.appSettings.config" | |
| echo ^<appSettings^> >> "$(ProjectDir)custom.appSettings.config" | |
| echo ^<add key="(key)" value="(value)"/^> >> "$(ProjectDir)custom.appSettings.config" | |
| echo ^</appSettings^> >> "$(ProjectDir)custom.appSettings.config" | |
| :SKIP |
| public class ExceptionLoggerTraceRedirector : ExceptionLogger | |
| { | |
| public override void Log(ExceptionLoggerContext context) | |
| { | |
| var logtext = new StringBuilder(); | |
| logtext.AppendLine($"Request: {context.Request}").AppendLine(); | |
| logtext.AppendLine($"Exception: {context.Exception}"); | |
| Trace.TraceError(logtext.ToString()); | |
| } | |
| } |
| # LICENSE - [The Unlicense](http://unlicense.org/UNLICENSE) | |
| cd (Split-Path ( & { $myInvocation.ScriptName } ) -Parent) | |
| $now = [DateTime]::Now | |
| for ($counter = 1; ; $counter++) { | |
| $dirName = "{0:yyyy-MM-dd}-{1:D3}" -f $now, $counter | |
| if (-not (Test-Path $dirName)) { | |
| md $dirName > $null | |
| break; | |
| } |
| # Enable .ps1 file in "New" items on Windows Explorer folder context menu. | |
| # LICENSE - [The Unlicense](http://unlicense.org/UNLICENSE) | |
| New-PSDrive -name HKCR -PSProvider Registry -root HKEY_CLASSES_ROOT | |
| New-Item HKCR:\.ps1\ShellNew | |
| New-ItemProperty HKCR:\.ps1\ShellNew NullFile -propertyType String |