Posts

Gitlab: Switching to Access Tokens with Your Repos

If you haven't yet switch to using Access Tokens for your repo clone. Enable your  Two-Factor Authentication and create an access token under your profile. I've done this with my gitlab and keep forgetting the quick way to update the path/command. Go to https:/// YOURGITLAB.com/ profile/two_factor_auth Then go to  https:// / YOURGITLAB.com/ profile/personal_access_tokens  create a token with the api setting. Now switching your remote url for your git is simple. Using this command.. git remote set-url origin http://USER:TOKEN@YOURGITLAB.com/repo.git If you have multiple origin urls you might have to remove them and add back an origin upstream and reset the origin master as the default upstream. This doesn't normally happen but I had a unique case where I had multiple urls for the origin where I was pushing to multiple repos for the same code. This probably won't be your case but I figure I might add this bit in.

Angular 1.X Filter by Properties

Filtering By Nest Property $scope.list = [ { 'Name': 'A', 'Manager': { 'Name': 'X' } }, { 'Name': 'B', 'Manager': { 'Name': 'X' } }, { 'Name': 'C', 'Manager': { 'Name': 'Y' } }]; <ul> <li ng-repeat="e in list | filter: {Manager: {Name: filter.key}}"> {{e.Name}} (Manager: {{e.Manager.Name}}) </li> </ul> F ilter not equals <li class = "list-group-item" ng-repeat = "question in Questions | filter:{ Id: '!-1'}" > <div href = "#" editable-text = "question.Text" > {{question.Text}} </div> </li> How to get key of the object?   (not in the view) The first parameter to the iterator in  forEach  is the value and second is the key ...

Aspetcore: NLog with Postgresql

This Article is base ASP.Net Core 2 and the latest version of Nlog. 1. Install NLog and the Postgresql Package Using NuGet to install the package into your ASP.NET Core project: PM > Install-Package NLog.Web.AspNetCore PM > Install-Package Npgsql 3. Register NLog Add in your Startup.cs  public void Configure ( IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory ) { ... env.ConfigureNLog( "nlog.config" ); ... // make sure Chinese chars don't fk up Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); //add NLog to ASP.NET Core loggerFactory.AddNLog(); //add NLog.Web app.AddNLogWeb(); } 4. Add to Your Controller Add a logger object to your Controller. private readonly ILogger<YourController> _logger; Modify the constructor to use it public YourController ( ILogger<YourController> logger = null ) { if ( null != logger) { _logger = logger; ...

Popular posts from this blog

Aspetcore: NLog with Postgresql

Mongodb Cheatsheet

Installing Windows on Acer chromebook 15 cb3-532