Type | Item |
---|---|
Motherboard | ASUS PRIME Z790-P WIFI D4 |
Case | [be quiet! Dar |
function Get-OneDriveFolder | |
{ | |
<# | |
.Synopsis | |
Gets the current user's OneDrive folder. | |
.Description | |
Gets the current user's OneDrive folder. | |
.Example |
I hereby claim:
- I am shmuelie on github.
- I am shmuelie (https://keybase.io/shmuelie) on keybase.
- I have a public key whose fingerprint is 5E6F 469D 9CFA 4573 CDAB 7422 4805 122F E963 542E
To claim this, I am signing this object:
chocolatey install -y 7zip adb chocolatey-core.extension chocolatey-windowsupdate.extension discord docfx elevate.native exiftool ffmpeg fiddler Firefox gimp git.portable gradle jq mkvtoolnix msbuild-structured-log-viewer obs-virtualcam pdfsam python3 scrcpy sysinternals visualstudiocode-disableautoupdate vlc vscode vswhere adoptopenjdk audacity cpu-z hwmonitor nodejs obs-studio rufus twitch powertoys intellijidea-community |
var b,c,d=new Date(+new Date+2592e11),e=Cookies.getJSON("global_ad_params")||{};e.ab={value:"off",expiration:d.getTime()},b=_.isUndefined(urlParams.force_ab)?Cookies.get("forbes_ab"):urlParams.force_ab.toUpperCase(),c=b&&b[0].match("A")?b[0]:"A",Cookies.set("forbes_ab",c,_.merge({expires:d})),Cookies.set("global_ad_params",e,_.merge({expires:d})),a?(Cookies.set("welcomeAd",!0,_.merge({expires:d})),Cookies.set("dailyWelcomeCookie",!0,_.merge({expires:d}))):(Cookies.remove("welcomeAd"),Cookies.remove("dailyWelcomeCookie")); |
#Package Current Folder | |
Get-ChildItem .\ -File -Recurse -Force | select @{"Label"="Name";Expression={$_ | Resolve-Path -Relative}},@{"Label"="Data";Expression={[convert]::ToBase64String(($_ | Get-Content -Encoding byte -ReadCount 0))}} | ConvertTo-Json | Set-Content .\Package.json | |
#Unpackage | |
Get-Content .\Package.json | ConvertFrom-Json | ForEach-Object { Set-Content -Encoding Byte -Value ([convert]::FromBase64String($_.Data)) -Path $_.Name } |
(Note: Code is using .NET Core and ASP.NET Core that is in VS 2015 Update 2)
When you want to return XML in ASP.NET Core the Microsoft.AspNet.Mvc.Formatters.XmlSerializerOutputFormatter
is used. Internally XmlSerializerOutputFormatter
uses System.Xml.Serialization.XmlSerializer
to actually serialize the .NET Objects into XML. Unfortunaly XmlSerializer
has some limitations, particularly around serializing collections. To solve this a concept of "wrappers" was introduced. Wrappers replace an object of type A
with type AWrap
and AWrap
provides all the same data but is XmlSerializer
safe. ASP.NET Core comes with a wrapper for collections built in. However, to use it you must write you own wrappers for your classes that consume it when they have collections.
Instead of creating wrappers for a complex and growing object model, I created a system that uses type generation at runtime to create wrappers for types as needed. Unfortunately some limitations in .NET Core made this more complex then somet