Enter file contents here## create database
@{ q = "create database mydb" } | Invoke-WebRequest -Method Get -Uri "http://localhost:8086/query"
> php .\bootstrap\api.php get "/weekday/2015/5/5" | |
200 OK | |
content-type: application/hal+json | |
{ | |
"weekday": "Tue", | |
"action": "/weekday", | |
"year": "2015", | |
"month": "5", | |
"day": "5", |
<?php | |
namespace Embed\Sample\Resource\App; | |
use Bear\Resource\ResourceObject; | |
use Bear\Resource\FactoryInterface; | |
use Bear\Resource\AbstractUri; | |
class PeriodCollection extends ResourceObject { | |
/** |
type MarkdownDocument = MarkdownBlock list | |
and MarkdownBlock = | |
| Heading of int * MarkdownSpans | |
| Paragraph of MarkdownSpans | |
| CodeBlock of string list | |
| BlockQuote of MarkdownBlock list | |
and MarkdownSpans = MarkdownSpan list |
function LoadAssembly { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[string[]]$asmNames, | |
[string]$baseDir = $PSScriptRoot | |
) | |
begin { | |
$domain = [System.AppDomain]::CurrentDomain | |
[Reflection.Assembly[]]$asms = $domain.GetAssemblies() |
New-Process (Resolve-Path .\usr\bin\influxd.exe) "-config $(Resolve-Path .\etc\influxdb\influxdb.conf)" | | |
Enable-TextLog -RedirectStandardError access_log -Verbose | | |
Launch-Process | |
New-Process (Resolve-Path .\usr\bin\influxd.exe) "-config $(Resolve-Path .\etc\influxdb\influxdb.conf)" | | |
Enable-EventLog -RedirectStandardError Access -Verbose | | |
Launch-Process |
$root = "HKCU:\Software\Borland\Delphi\7.0" | |
$rootDir = (ls $root\.. -Include "7.0" -Recurse).GetValue("RootDir") | |
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
function Update-DccLib { | |
$reg = ls $root -Include "Environment Variables" -Recurse | select -First 1 | |
$envVars = @{ '$(DELPHI)' = $rootDir } | |
$reg.Property | %{ $envVars.Add([string]::Format('$({0})',$_), $reg.Getvalue($_)) } |
function BoilerplateFunction { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[IO.FileInfo[]]$files | |
) | |
begin { | |
$xls = New-Object -ComObject Excel.Application | |
$xls.Visible = $false | |
$xls.DisplayAlerts = $false |
$s = "I have a pen. I have a apple. oh!! Apple pen! I have a pen. I have a pineapple. oh!! Pineapple pen! Apple pen. Pineapplepen. Pen pineapple apple pen." | |
$s -split(' ') | ?{ $_ -match "(\w+)[^.!]?" } | %{ $matches[1] } | group | select -Property Name,CountName | |
# Name Count | |
# ---- ----- | |
# I 4 | |
# have 4 | |
# a 4 | |
# pen 7 | |
# apple 4 |