Posts

Angular 9: Bootstrap Model Error handling and a better Component

Constantly pushing my content into modals and so I can make the call asynchronously and speed up the page in little ways. https://stackoverflow.com/questions/37793418/how-to-return-http-500-from-asp-net-core-rc2-web-api https://stackoverflow.com/questions/12948156/asp-net-mvc-how-to-disable-automatic-caching-option Related issue with an example using Jquery https://kwilson.io/blog/post-an-array-of-objects-to-webapi-using-jquery/ Modal Handling with Components http://plnkr.co/edit/3gMgeAUyIoKCjkXq0M9y?p=preview Component scope passing http://plnkr.co/edit/2JNhMguMMMABA7MVVddx?p=preview Angular Interceptor https://scotch.io/@vigneshsithirai/angular-6-7-http-client-interceptor-with-error-handling Extra Notes https://github.com/angular-ui/bootstrap/issues/6501 https://stackoverflow.com/questions/46663568/how-to-handle-ctrl-in-angularjs https://sebnilsson.com/blog/display-local-datetime-with-moment-js-in-asp-net/ https://stackoverflow.com/questions/34958681/what-is-the-best-...

No EventLog for Aspnet Core with Nlog

 If you trying to pass a json object you can still do so just not with the EventLog object. Instead just use the MS LogIformation method with the object as your parameters. I still havent got it to format the json object in the logs but for now this is a solution. Another solution is to pull the nlog object in and not use the MS LogInformation in Logger log = LogManager.GetCurrentClassLogger();  I haven't done this yet but I dont see a logical issue just bad design  https://github.com/NLog/NLog/issues/2106 https://stackoverflow.com/questions/39099601/how-can-i-configure-json-format-indents-in-asp-net-core-web-api https://github.com/NLog/NLog/issues/2629 https://stackoverflow.com/questions/34679727/use-nlog-in-asp-net-core-application https://stackoverflow.com/questions/44048187/layout-nlog-properties-as-json Example:  https://github.com/NLog/NLog.Web/blob/master/examples/ASP.NET%20Core%203/ASP.NET%20Core%203%20-%20VS2019/Controllers/HomeController.cs https://github.c...

Bootstrap: Spacing between Stack Items

For non-frontend developers bootstrap is already an great way to get started, I've said that for years. However I find .net developers using custom styles rather then whats involved in bootstrap. Its why I created flavorstrap, for ppl creating custom styles to use extension or to keep the naming convections similar. Margin utilities -  ml-auto  and When it stacked I recommend the following between the two items.. < div class = "d-block d-md-none col-12 py-3" > </ div > That way it only appears when you need it to and prevent cells from being on top of each other for smaller screens. However with bootstrap 5 this solution is even easier. Using the new Spacing style just follow the documentation,  {property}{sides}-{breakpoint}-{size}.

Visual Studio: Disable Dll Culture Folders on Compile

Quick solution that helped me remove extra files in my bin folder, sometimes I need to publish files on to server and the smaller they are the better. In my case I had different culture files/folders for the Microsoft.CodeAnalysis.CSharp.  Solution   <PropertyGroup>     <TargetFramework>net5.0</TargetFramework>     <SatelliteResourceLanguages>en-US</SatelliteResourceLanguages> </PropertyGroup> I could also add this to the package itself but the package didnt appear to be referenced directly in the .csproj. I think it was only referenced in the nuget config file, in any case this fixed the problem globally. Example for package < PackageReference Include = "Microsoft.CodeAnalysis.CSharp" Version = "3.0.0" ExcludeAssets = "All" /> Also worth noting I didnt use "en-US" I used just "en" which worked just as well, that might make a difference on some project.

Aspnet: IncludeScopes for Providers

On a previous job I had this in my appsettings.json,      {     "Logging": {         "IncludeScopes": false,         "LogLevel": {           "Default": "Information",           "Microsoft": "Warning",           "Microsoft.AspNetCore": "Warning",           "Microsoft.Hosting.Lifetime": "Trace"         }       }     } Getting a warning message, "logging configuration for provider. The provider name must match the configuration's json property name." This doesn't help me understand why its looking warning for an object. If it helps I'm using nlog but this warning still appears even if I remove nlog. After writing this I found the docs here:  Logging in .NET Core and ASP.NET Core And the following fixes my warning:      "Logging": {        ...

7 Days to Die Server on Ubuntu with background service

Sometime back I created a service for this game so I didnt have to manage it in a separate terminal. Saw a lot of tutorials that used this method, thankfully I have know linux well enough to improve this. Important to look over the  serverconfig.xml . I've noticed it you have an error in the server config the game just doesn't start but that could have been combined with other bugs I was working out at the time of writing this. In any case need to make sure all  things are in order before adding this service solution. Step one: Create File vim  /etc/systemd/system/ sdaysded.service chmod u+x sdaysded.service sudo systemctl enable sdaysded.service Step Two: Write to File [Unit] Description=sdaysded service After=network.target StartLimitIntervalSec=0 [Service] #User=steam Restart=always RestartSec=1 #WorkingDirectory=/home/sdaysded ExecStart=/home/sdaysded/startserver.sh -configfile=/home/sdaysded/serverconfig.xml [Install] WantedBy=multi-user.target Step 3: Test journalct...

Using Angular-Datatables Notes

These notes are based on angular-datatables v 8.0.0   Using Angular Component In order to get a angular component say to run you need to create the code in the same scope. That's how I managed to get it running. So for example you have to create a model via angular and attach it to a jquery event. What your doing is in the definition of the datatable is passing the logic in at that point on how to run.   import  {  Component ,  OnDestroy ,  OnInit ,  ViewChild ,  AfterViewInit  }  from   '@angular/core' ; import  {  Meta ,  Title  }  from   '@angular/platform-browser' ; import  {  HttpClient  }  from   '@angular/common/http' ; import  {  NgbDateStruct ,  NgbModal  }  from   '@ng-bootstrap/ng-bootstrap' ; import  { formatDate }  from   "@angular/common" ; import  {  DataTableDirective  }  from   'angu...

Popular posts from this blog

Aspetcore: NLog with Postgresql

Mongodb Cheatsheet

Installing Windows on Acer chromebook 15 cb3-532