Posts

Showing posts from 2019

Angular 8 Material - mat-slide-toggle is unknown!

Currently wrapping things up with the project: MyPatco and you can find the repo here for example. Under my angular5 repo which isn't really angular 5 anymore but infact angular 8. That tells you how long its been since I've actually been working on this project. Or it could say how quickly angular is updating. Either way I'm going through my notes and writing about all the bugs I faced as I do with all my projects. This was probably the easiest bug but one that I thought was very interesting. I would have thought the component would be in scope give the fact that its under the library material. However it needs to be imported explicitly. Which makes me wonder what other pieces or components need to be imported as well. I currently use a small set of features for mypatco, I do plan to add notifications. I have the features listed out either in my issues under mypatco and whatever extra libraries I use under the repo's wiki. To answer my question from earlier,  &qu

A Small Business's Expenses & Sustainability

Image
    Back in 2018, I made the incredible life decision to purchase my shop. Since then I've been taking care of small maintenance problems that I was aware of around the time of my purchase. At the begin of 2019 I drove back and forth between Philly and my shop. Which meant keeping an eye on heat costs and a few roof leaks from afar. Now that I'm closer to my shop and I had a chance to take care of some of the things.   The first thing I did was look at the electrical system. To be more energy efficient I put the money down to upgrade to LED's.   Removing all ballasts helped, still I have a ton of plans to improve my efficient. For starters getting   off the grid which a neighbor currently is doing. Since electricity is my biggest expense at the moment its the first thing to be upgrade. Managing a web host company really only costs two things, electricity and internet. Luckily electricity isn't much but its where I can save the most . Leaky roof The sh

Installing Windows on Acer chromebook 15 cb3-532

Image
Much of my notes are just small problems I faced (what's new!) haha. Either way this was a really fun project to do for a friend and I got excited once I research all the information. You can find instruction videos but what helped me the most was the coolstar website. Sadly they don't have parameters in the url so I can link the machine I used in this article. -  https://coolstar.org/chromebook/windows-install.html Scared of messing with the bios? Don't be!    So you need to first remove the screw to put a legacy bios on the machine. Its easy to backup the chrome os one and with the same steps to change it. You can go back in and revert to the chrome version bios. Its that last part that had me worried and its very easy to do.  Problems getting into Developer Mode?   Follow the instructions to the letter, during the step to disable the OS verification, press Ctrl-D to boot into os. If you hear two beeps I would go back to set one. I got in a loop where it s

Schema.org: Separate Product or ItemList Products?

This started to be a little be more of a challenge one night more then I thought. The issue was that I need to have position in my list of products. Which were in a ItemList when I used the itemtype in the same div I didn't have the option to add position ; a requirement for ItemListElement. This all came from about because I was simplifying my list of products by just displaying them on a single page with prices. I wanted to put them list however looking back after a long night I could have easily just listed them as separate Product types. So to summarize the issue I wanted to meet all the requirements from Google's Structured Data Tool and didn't think listing them as multiple Products was right and instead did them as ItemList. Not to be confused with ListItem which is a type that can be at the root but also under ItemListElement. Its all very confusing at first glance. The next question I asked...  Is it okay to have more than one Product Example: (this doesn

Angular + Bootstrap 4 Navbar with Right Dropdown

From reading the document on bootstrap (version: 4.3.1)  and comparing my notes from version 3. There doesn't seem to be an example for a right dropdown with a navbar. Flexboxes can be a challenge and moving from bootstrap 3 isn't but here is some solutions. https://stackoverflow.com/questions/51013313/bootstrap-dropdown-with-angular-6 https://ng-bootstrap.github.io/#/components/dropdown/examples https://stackoverflow.com/questions/51013313/bootstrap-dropdown-with-angular-6 Examples -  https://www.codeply.com/go/bRSyq1ooFu/bootstrap-4-navbar-dropdown-right -  https://www.codeply.com/go/cxXqBnGrPx  (icon on the right) -  https://www.codeply.com/go/1ZFF5CEXM5 https://www.codeply.com/go/1ZFF5CEXM5 https://medium.com/wdstack/bootstrap-4-custom-navbar-1f6a2da5ed3c https://www.codeply.com/go/bRSyq1ooFu/bootstrap-4-navbar-dropdown-right With Queryjs  I should probably put this in another article, still I'm killing two birds with one stone.

Custom Linux Command to Generate Sites

Image
So I created a Linux command for myself to setup websites rather by hand anymore. What took me 10 to 15 minutes now is just down to less then a minute where I can just pass parameters and go! This article is a place holder for the documentation and some notes so later if I need to create another command. How it works... For the setup I have a setup start out checking for sudo and gain access because I'm going to modify a lot of folders. Taking the users input I add a file in Nginx first in sites-available then link it with sites-enabled. I pass the input in the file to have both the naked domain then the www version. From there its setting up a gitlab task-runner. Later down the road I might just convert everything to docker and might not need to setup a folder in /var. However for now I like this setup, so the last step is creating and pushing out the web service for the application. For now I do this last part manually because I have to test the package version and enviro

Gitlab: Local Continuous Integration with Docker & Dotnetcore

Started this in the beginning of the year...    On a Friday night, I spent my time working up til 6 in the morning on this. Probably the most difficult but simple process I've completed. Still proud that I completed it in a single night despite all the challenges. Some of which actually helped me create a solution more professional in my opinion. Meaning I didn't just create a work around. For example in my research I found other developers using scp (secure copy in linux) with sshpass  which isn't problem when deploying remotely. However I needed to do it locally. So for me using an ssh really seems waste for internal Processing. At the time creating this solution though I didn't care I need something fast. I should also note I'm not using docker to host my aspnetcore app but using the gitlab-runner in docker.  Update to now I've come a long way now to where creating task runners is a lot easier and I'm spinning them up specifically for each project ne

NLog Killing Aspnet Core Application

Image
Awhile back I moved to a new location for storing my server and for the most part things went smoothly. Didn't have any issues with my local DNS or emails, however I did encountered one issue. The issue was Recycled Motors where the application would boot but instantly fail. Which didn't create any logs or errors for me to look. So it took me a few weeks along with everything else going on to figure this one out. I spend a little too much time looking into my network and the bind9 configs because I know it had to do with my configs. Originally I was on a 10.0.10.x network but with the I.P. the modem only allowed the regular 192.168.1.x ip address. Eventually I figured out the issue, being my NLog config itself. I have it writing in a database where I list the ip address explictly. I completely forget about this since it was just a quick thing I added a few weeks before the move and I still have it pointed to localhost in the appsettings.json Solutions Use different envir

.NET Core Docker Image for SPA Applications

If your looking to get CI/CD up and running with a SPA Application I recommend this setup. This article is based on Aspnet Core 2.1 and up. If you read the docker docs on the 2.1 version of dotnet core you will see they removed nodejs, which breaks a bunch of stuff if your using dotnet core with either Angular2 or Reactjs. I currently use gitlab-runners but with the volumes config to publish my sites. Notes from Dotnet Using NodeJS in  microsoft/aspnetcore-build , but this is missing from  dotnet/core/sdk:2.1 . What should I do? You can either install NodeJS by adding a few lines of code to your Dockerfile that download and extract NodeJS, or you can use the multi-stage feature of Docker and the official NodeJS images. Sample code to install NodeJS on your own: # set up node ENV NODE_VERSION 8.9.4 ENV NODE_DOWNLOAD_SHA 21fb4690e349f82d708ae766def01d7fec1b085ce1f5ab30d9bda8ee126ca8fc RUN curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x

Randomly Return Rows in EFCore with Postgresql

Currently working on a random list motorcycles to display on my front. At the moment don't have any priority listening on my site for clients other than the list of bikes I'm trying to sell personally as a source of income. For now this is what I did and its just these two parts to get things going. something . OrderBy ( r => Guid . NewGuid ()). Take ( 3 ) If you don't already have the extension this command will check and install for you. CREATE EXTENSION IF NOT EXISTS "uuid-ossp" ;

Entity Framework: ToListAynsc & WhereAsync

When upgrading aspnet mvc applications I like to take a look on how I can convert the api's to async. This sometimes is really easy but as things get more complex my queries do as well. So this is a list of ways you can form a where clause on top your  async  but note not all solutions take advantage of it. Notes on EFCore Entity Framework Core provides a set of asynchronous extension methods that can be used as an alternative to the LINQ methods that cause a query to be executed and results returned. Examples include  ToListAsync() ,  ToArrayAsync() ,  SingleAsync() , etc. There are not async versions of LINQ operators such as  Where(...) ,  OrderBy(...) , etc. because these methods only build up the LINQ expression tree and do not cause the query to be executed in the database. https://codereview.stackexchange.com/questions/32160/filtering-a-collection-by-an-async-result Filtering a collection by an async result ,  built an extension method called WhereAsync. publ

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql