Langsung ke konten utama

Postingan

Semantic commit

Semantic  link  
Postingan terbaru

Check connection db postgres di node js

Install package npm init -y npm i pg dbConfig sesuaikan dengan di localmu const { Client } = require ( ' pg ' ); // Konfigurasi koneksi database PostgreSQL const dbConfig = { user: ' root ' , host: ' 0.0.0.0 ' , database: ' check-db ' , password: ' root ' , port: 5151 , }; // Membuat instance client PostgreSQL const client = new Client (dbConfig); // Fungsi untuk melakukan pengecekan koneksi const init = async () => { try { // Menghubungkan client ke database await client . connect (); console . log ( ' Koneksi ke database berhasil. ' ); // Menutup koneksi client await client . end (); } catch (error) { console . error ( ' Gagal terhubung ke database: ' , error . message ); } }; // Memanggil fungsi untuk melakukan pengecekan koneksi init ();

Install adb on mac os

Delete your old installation (optional)  rm -rf ~/.android-sdk-macosx/ Download  adb   Go folder download  cd Download Unzip file unzip platform-tools-latest*. zip Create and move adb mkdir ~/.android-sdk-macosx mv platform-tools/ ~/.android-sdk-macosx/platform-tools Add platform your path echo 'export PATH=$PATH:~/.android-sdk-macosx/platform-tools/' >> ~/.bash_profile Refresh your bash profile (restart terminal) source ~/.bash_profile Start adb devices adb devices

Setup react native ANDROID_HOME

  Go to android project - cd android Create file local.properties windows  sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk mac sdk.dir = /Users/USERNAME/Library/Android/sdk ubuntu sdk.dir = /home/USERNAME/Android/Sdk

How to use CKEditor in Nuxt Js

Requirement:  Node 14.18.3 NPM 6.14.15 Yarn 1.22.4 yarn add @ckeditor/ckeditor5-vue@23.0.0 yarn add @blowstack/ckeditor5-full-free-build@1.0.2 // plugins/ckeditor.vue import Vue from ' vue ' import CKEditor from ' @ckeditor/ckeditor5-vue ' Vue . use ( CKEditor ) // components/CkEditor.vue < template > < ckeditor : editor = " editor " : value = " value " : config = " config " @ input = " ( event ) => $emit ( ' input ' , event) " /> </ template > < script > let FullFreeBuildEditor; let CKEditor; if (process . client ) { FullFreeBuildEditor = require ( ' @blowstack/ckeditor5-full-free-build ' ); CKEditor = require ( ' @ckeditor/ckeditor5-vue ' ); } else { CKEditor = { component: { template: ' <div></div> ' } }; } export default { name: ' CkEditor ' , components: { ckeditor: CKEditor . component , }, p...

Cara menggunakan lodash di template vue js

Lodash render didalam tag <template>  Jika ingin menggunakan di dalam page (bukan global component) import _startCase from ' lodash/startCase ' <template>      {{ _startCase ('no_access') }} </template> methods: {      _startCase, } Jika ingin global template expression component {{_ . camelCase ( " vue lodash! " )}} import _ from 'lodash'; const VueLodash = { install(Vue, options) { Vue.prototype.$_ = _; Vue.mixin({ mounted() { // Just tell you that it is mounted // console.log('VueLodash'); } }); if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(VueLodash) } } }; export default VueLodash; source:  link