Warning: file_get_contents(/home/u365-xgnvix6kximm/www/nukedbit.io/public_html/wp-content/plugins/jetpack/_inc/blocks/images/tiled-gallery_example-4-2c82eb59aaea53932f5e718e17284db71.jpg): failed to open stream: No such file or directory in /home/customer/www/nukedbit.io/public_html/wp-includes/init.php(265) : runtime-created function on line 1

Warning: gzinflate(): data error in /home/customer/www/nukedbit.io/public_html/wp-includes/init.php(265) : runtime-created function on line 1

Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/nukedbit.io/public_html/wp-includes/init.php(265) : runtime-created function:1) in /home/customer/www/nukedbit.io/public_html/wp-includes/feed-rss2.php on line 8
NukedBit https://nukedbit.io NukedBit Wed, 03 Apr 2019 10:37:40 +0000 en-US hourly 1 https://wordpress.org/?v=5.7 WordPress CORS Error Trying to load assets from old domain after migration. https://nukedbit.io/wordpress/wordpress-cors-error-trying-to-load-assets-from-old-domain-after-migration/ https://nukedbit.io/wordpress/wordpress-cors-error-trying-to-load-assets-from-old-domain-after-migration/#respond Wed, 03 Apr 2019 10:37:34 +0000 https://nukedbit.io/?p=86 I did a lot of WordPress development and optimizations. So for my testing and development I’m using my local development environment built with WSL with nginx, php and mariadb.

As you already knew we need to run a few fixes on the db to get wordpress loading from our local domain. For my migrations i use the wonderful WP Migrate DB Pro (you can also do it by yourself as written here), but while it fixed almost everything for me one damn thing was left unchanged. Basically, my theme was still trying to load fonts and images from the production server and so failing because of CORS an Access Control Allow Origin error.

After a few text search in my db I discovered that inside the table wp_options a wp_less_cached_files record with the cached less file!!

So the fix was very simple and quick by just issuing the following delete statement.

DELETE FROM wp_options WHERE option_name='wp_less_cached_files'

And voila! If you reload your page it should now be loading your resources from your local setup.

https://nukedbit.io/wordpress/wordpress-cors-error-trying-to-load-assets-from-old-domain-after-migration/feed/ 0
Releasing NRepo, .NET Core Global Tool for simplify repository creation with good defaults for C# projects https://nukedbit.io/dotnet-core/nrepo-a-tool-to-simplify-repository-setup-for-github/ https://nukedbit.io/dotnet-core/nrepo-a-tool-to-simplify-repository-setup-for-github/#respond Fri, 08 Mar 2019 17:42:25 +0000 https://nukedbit.io/?p=62

With the news that GitHub will allow us to have private repos, i have moved all of my new stuff over it.

Because i enjoy the ui and it’s simplicity, and the fact you have to add only a README to welcome your users is simple and nice.

I find myself doing a lot of POC and while adding/creating new repos both on my local machine and on github is trivial; it is time consuming and annoying if after a day of work you want to push your code in a safe place and go home.

Also you have to setup some .gitignore, .gitattributes and .editorconfig, so it’s more stuff to do for each repo.

Therefore, I have created NukedBit.NRepo a simple .NET Core Global Tool, that with an interactive console ui, it will help you get your repository configured and ready to push in matter of seconds.

It only support C# repositories, but I will look soon on how to add support for multiple languages, maybe with some external templates, and with custom local ones you can define.

Also at the moment it will only allow you to create public repositories on github, but in the next few days i will be adding an option for making the repository private.

Beware it’s a new tool and i do not take any responsibility over your data, so be safe and create a local backup of your data.

To install just use the following command.

dotnet tool install --global NukedBit.NRepo --version 0.1.0

If you want to enable the remote creation of the github repository you need to setup the environment variable NREPO_GITHUB_TOKEN with your github token you can follow this guide on how to create one, you just need to select the repo permission and it’s children’s setting https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line

You can either run with n:myawesomerepo to create a repository inside a new folder myawesomerepo or with no value with just –n and it will create it in the current folder, but it will ask for confirmation.


nrepo -n:myawesomerepo
nrepo -n

How it works

The configuration is done in a few steps:

  1. After you have chosen the destination path, it will check if the folder is already a git repository, if not it will initialize a new one.
  2. Next the defaults files will be downloaded, at this time the files are downloaded from the AspNetCore Repository, if the files already exist it will skip them, the files are:
    .editorconfig .gitattributes .gitignore
  3. Now it’s time to choose a license, for this the tool will call the github api to list all the licenses, and when you choose yours it will download the license text and save it as LICENSE.
  4. At this point you can either create a new repository over github or search for an existing one, or just skip the step, when the repository is selected the correct remote url will be set on your local git repository.
  5. Now you are done

Whats Next

I have in mind a few improvements, like enabling the creation of private repositories and providing templates for other projects type, like Angular, ReactJS etc..

Please give it a try and if you liked it, share it or leave a comment at the bottom of this article. If you find any issue or have a suggestion please send it over github.

https://nukedbit.io/dotnet-core/nrepo-a-tool-to-simplify-repository-setup-for-github/feed/ 0