(?<!/)MIDOFFICE
- only match if there is NOT a slash (/) before the match (i.e. don't match URLs)
(?<=- "?)MIDOFFICE
- trying to match kustomize env var literal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/source/myapp/ui | |
$files = (ll -r *.yml | sls -SimpleMatch 'APPOFFICEODATA_URL'); | |
$files | |
#$files2 = $files[8..14] | |
#foreach ($f in $files2) { | |
foreach ($f in $files) { | |
sed -i "$($f.LineNumber - 1) a\ - APPDATA_URL=/myapp/admin" $f.Path | tee.exe -a sed-log.log; | |
echo (" APPDATA_URL added to "+$f.Path) | tee.exe -a sed-log.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Globalization; | |
using CsvHelper; | |
//namespace AppFoo; | |
// Counts rows. Helps when streaming to CSV from query that uses EF Core `.AsAsyncEnumerable()`. | |
public class CsvWriterCounter : CsvWriter | |
{ | |
int _counter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fromDir='/code/repo01'; cd $fromDir | |
$todir='../repo02'; | |
git diff --name-only --cached | %{ cp $_ (join-path $todir $_) -WhatIf } # WhatIf shows what it will do | |
Read-Host -Prompt 'Press any key to continue or CTRL+C to quit'; | |
git diff --name-only --cached | %{ cp $_ (join-path $todir $_) -v } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# by ahmed on SO, https://stackoverflow.com/a/74122351/195755, NOT by @yzorg | |
FILES=`git ls-files --modified` | |
export_dir="place your export dir" | |
for x in $FILES | |
do | |
prev_dir=$PWD | |
folder=$(dirname $x) | |
echo "Exporting to..." $export_dir/$x | |
cp $prev_dir/$x $export_dir/$x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reg key is from https://superuser.com/a/1767917/31557 | |
$BorderWidthValue = -100 | |
#$BorderWidthValue = -200 # uncomment this to make them really wide, @yzorg likes -100 so kept that default | |
# make a backup of current value | |
pushd ~\Documents | |
reg export 'HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics' .\registry-WindowMetrics-old.reg | |
pushd ('HKEY_CURRENT_USER\Control Panel\Desktop' -replace 'HKEY_CURRENT_USER','HKCU:') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# see https://gist.github.com/yzorg/e4e9813fc07bef4af10ae43febca38d9 | |
# function to convert file to UTF-8 | |
convert_to_utf8() { | |
iconv -f UTF-16 -t UTF-8 "$1" -o "$1".utf8 | |
mv "$1".utf8 "$1" | |
} | |
# output the list before making the 1st change |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
namespace Middle.MyApp | |
{ |
These folks seem to think [controller]
works in [ODataRoutePrefix("todo")] public TodoController : ODataController
- https://stackoverflow.com/questions/51809295/net-core-2-1-odatarout-not-working
- dotnet/aspnet-api-versioning#209
This seems to work:
[ODataRoutePrefix("todo")] public TodoController : ODataController
- more complete sample see https://stackoverflow.com/a/63852770/195755
This DOES NOT work, as far as I know:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Index</h1> | |
<form method="get"> | |
<p> | |
page @Model.PageNumber of @Model.TotalPages, | |
showing @Math.Min(Model.PageSize, Model.Count) of @Model.Count rows | |
</p> | |
<button type="button" class="btn btn-dark" | |
@Html.DisabledIf(Model.PageNumber <= 1) |
NewerOlder