Live Demo: https://repl.it/J6L1/0
// --------- PARAM ---------
const invocations = _`100_000_000`
const avgRuntimeInSec = 0.5
const avgMemoryInMb = 256
// --------- CALC ---------
const { Readable } = require('stream') | |
const charArray = 'abcdefghijklmnopqrstuvwxyz'.split('') | |
class AlphabetStream extends Readable { | |
constructor () { | |
super() | |
this.position = 0 | |
} |
# Download latest dotnet/codeformatter release from github | |
$repo = "dotnet/codeformatter" | |
$file = "CodeFormatter.zip" | |
$releases = "https://api.github.com/repos/$repo/releases" | |
Write-Host Determining latest release | |
$tag = (Invoke-WebRequest $releases | ConvertFrom-Json)[0].tag_name |
docker ps -a -q | xargs -r docker rm -f | |
docker images -a -q | xargs -r docker rmi -f |
$code = { | |
param ($id) | |
$start = Get-Date | |
# your code here | |
Start-Sleep 1 | |
$stop = Get-Date | |
$total = ($stop - $start).TotalMilliSeconds | |
"[$id] $total ms" | |
} |
' cscript.exe //B //NoLogo pid-cpu.vbs | |
set fs = createObject("Scripting.FileSystemObject") | |
set stdout = fs.getStandardStream(1) | |
' https://msdn.microsoft.com/en-us/library/aa393838(v=vs.85).aspx | |
set refresher = createObject("WbemScripting.SWbemRefresher") | |
set namespace = getObject("winmgmts:root\cimv2") | |
' https://msdn.microsoft.com/en-us/library/aa394323(v=vs.85).aspx | |
set perfdata = refresher.addEnum(namespace, "Win32_PerfFormattedData_PerfProc_Process").objectSet |
# PowerShell command to build a regex for Dim Files on Github | |
# see: https://github.com/bfred-it/dim-files-on-github | |
# README | |
# | |
# Copy-and-paste the lines below into your PowerShell. | |
# Then hit enter: The built regex will be copied to your | |
# clipboard automatically. | |
'^\.', ` |
'bc'.replace('', 'a') // => 'abc' |
$sites = az resource list --resource-type=Microsoft.Web/sites | convertfrom-json | |
$functionapps = $sites | where -property kind -eq functionapp |
Live Demo: https://repl.it/J6L1/0
// --------- PARAM ---------
const invocations = _`100_000_000`
const avgRuntimeInSec = 0.5
const avgMemoryInMb = 256
// --------- CALC ---------
Get-NetAdapter | Where Name -eq WiFi | Select -Expand MacAddress |