Launching app code in a simulator like Xcode or Android Studio
Loading the code in a platform - in this article, I'll be focusing on Android and iOS. Ionic app shell prompts for iOS and Android devices.
Here's a breakdown of the commands:
npm run build
This command is used to build your web app. It's typically associated with web development frameworks like Angular, React, or Vue. It compiles your web app source code into production-ready files.
Installing CKAN from package on Ubuntu 20.04
Install the CKAN package
Begin by cleaning up your server environment. Do this by updating Ubuntu’s package index:
sudo apt update
Now you can install the packages that CKAN requires (including ‘git’, which will allow you to install CKAN extensions):
sudo apt install -y libpq5 redis-server nginx supervisor
Response
Creating a bash script and executing it on OSX
Creating a bash script
Bash scripts are files containing code that tell your computer to do something. In this instance, I want to rename a batch files in a directory. Such as changing:
37351001 - BlueSpotted.jpg
37351008 -SpangledEmporer _ 0133A.jpg
37353003 -Black-Bream_3481 .jpg
37353004 -35 - Yellowfin.jpg
Instead having these files appear as:
How to fix an unprotected private key file
How to synchronize two remote Git repositories
Currently, I have a situation where I have two repositories. The first is where I've held the code since the beginning. The second has come on board recently and is the client repo. However, rather than shut the original down, I want to keep both running with the same code. How do I synchronise them so that they contain the same thing?
How to get your iOS App into TestFlight and begin testing it?
Working hard developing your app and now it's time to let others begin testing your team's work. Fortunately, the process is far more streamlined nowadays. Don't misunderstand my comment, for newbies there remain barriers and hurdles to cross.
The App I'm walking through today has been built with Typescript and Angular. The process is the same with native iOS app too.
How to get the base URL of a Drupal 9 site
My goal was to get the base URL and compare it with the URL of the link. Was it an internal or external link? You can get the hostname, "{your_domain}", directly from the getHost() request:
$host = \Drupal::request()->getHost();
However, if you need the schema as well, such as https://{your_domain}
$host = \Drupal::request()->getSchemeAndHttpHost();
Upload an image file using JSON:API
Whilst I had regularly used HAL to upload files through REST API, this is no longer an option given Hal is now deprecated and will be dropped in Drupal 10. Time to explore JSON:API.
Drupal modules to be installed
You will need to install
- JSON:API
- Media
Configuration for JSON:API
Alter the JSON:API to accept all:
Path: Administration > Configuration > Web services > JSON:API
Programmatically get a Drupal taxonomy term tid from it's name
How do you retrieve a taxonomy term tid value from it's name?
In this situation, use the loadByProperties function. Load the taxonomy term and then reset the array.
Note, reset - to set the internal pointer of an array to its first element.
See as follows:
Drupal - How do I programmatically set contextual filters?
If you are like me, almost every view I have will have this filter. So I regularly have the need to set a contextual filter programmatically. However, some won't and will have other contextual filters instead.
You can pass through the $view object the contextual filter params using the setArguments() method. Say you want to pass three node nids to the view to filter the results contextually: