Tuesday 15 February 2022

Vue.js where can I get my firebaseConfig details from .

 I have the following details that need filling in on my main.js page. 

const firebaseConfig = {
apiKey: "AAAAAAAAAAAAAAAAAAAAAAA",
authDomain: "some-domain.firebaseapp.com",
projectId: "some-project",
storageBucket: "some-project.appspot.com",
messagingSenderId: "11111111111111",
appId: "1:111111111111111:web:11111111111111",
measurementId: "G-88888888"
};



Where do we get the firebaseConfig information from ? 

First off let's get the API key.   Go to your Firebase Project page https://console.firebase.google.com/projec

Next to Project overview > click on Project settings. 



The next page will have your 'Web API Key'  .  However if it says 'Not configured' then all you need to do is go into your Authentication page first and then come back to this page.  

You'll see it's filled in now :)

However to see all your details on this page.  just type in 'firebaseConfig' and all the details are there in code lower on the page.







Friday 11 February 2022

Defining 'S3ToGCSOperator' in GCP Airflow DAG.

 I have the following operator that I want to use in this DAG.  3ToGCSOperator

transfer_data_s3_to_gcs = S3ToGCSOperator(
task_id='data_transfer_gcs_to_gcs',


However I need to define the import. 

Which is 

from airflow.providers.google.cloud.operators.s3_to_gcs import S3ToGCSOperator


What you need to do is your Environment in GCP and navigate to the ‘PYPI PACKAGES’ TAB.
And add the package https://airflow.apache.org/docs/apache-airflow-providers-google/stable/index.html

apache-airflow-providers-google

However I then got this error. 


UPDATE operation on this environment failed 5 minutes ago with the following error message:

Failed to install PyPI packages. apache-airflow-providers-google 6.3.0 has requirement google-ads<14.0.1,>=12.0.0, but you have google-ads 7.0.0.

 Check the Cloud Build log at https://console.cloud.google.com/cloud-build/builds/%%?project=4%% for details. For detailed instructions see https://cloud.google.com/composer/docs/troubleshooting-package-installatio


So what you need to do first in ‘PYPI PACKAGES’ is install oogle-ads. Version =  >=12.0.0,<14.0.1.


ModuleNotFoundError: No module named 'airflow.providers.google.cloud.operators.s3_to_gcs'

And then you'll be able to do it. 

Tuesday 1 February 2022

Create a written date in Javascript 'moment' library.

The dates I'm outputting at the moment look like this. 



Which looks like this with 'moment' 

const written_date = moment(my_date).format('MMM d YYYY');


However, what I want is more of a fullText response. 

Moment has these name types. 

type RelativeTimeKey = 's' | 'ss' | 'm' | 'mm' | 'h' | 'hh' | 'd' | 'dd' | 'w' | 'ww' | 'M' | 'MM' | 'y' | 'yy';
type CalendarKey = 'sameDay' | 'nextDay' | 'lastDay' | 'nextWeek' | 'lastWeek' | 'sameElse' | string;
type LongDateFormatKey = 'LTS' | 'LT' | 'L' | 'LL' | 'LLL' | 'LLLL' | 'lts' | 'lt' | 'l' | 'll' | 'lll' | 'llll';


For what I wanted to achieve this works for me. 

const written_date = moment(my_date).format('ddd LL');