Posts

bulk image compress - nodejs

 const fs = require("fs"); const path = require("path"); const sharp = require("sharp"); // ============================================================ // BULK IMAGE COMPRESSOR // Node.js + Sharp + libvips // ============================================================ const SOURCE_DIR = path.join(__dirname, "creek-bay"); const TARGET_DIR = path.join(__dirname, "creek-bay-compress"); // ------------------------------------------------------------ // COMPRESSION QUALITY // // 1   = maximum compression / lowest quality // 100 = highest quality / lowest compression // // Recommended starting values: // // JPEG  : 60 - 80 // WebP  : 60 - 80 // AVIF  : 40 - 70 // // ------------------------------------------------------------ const COMPRESSION_QUALITY = 60; // ------------------------------------------------------------ // OUTPUT FORMAT // // null     = KEEP ORIGINAL FORMAT // // "webp"   = Convert all compatible images to WebP //...

Redirect in contact from 7

 /** Redirect Tab In Contact Form 7 Start */ // custom tab add_filter('wpcf7_editor_panels', 'cf7_add_redirect_panel'); function cf7_add_redirect_panel($panels) {     $panels['redirect-panel'] = array(         'title' => __('Redirect Settings', 'cf7'),         'callback' => 'cf7_redirect_panel_callback'     );     return $panels; } // panel content function cf7_redirect_panel_callback($post) {     $form_id = $post->id();     $selected_page = get_post_meta($form_id, '_cf7_redirect_page', true);     $pages = get_pages(); ?> <div class="cf7-redirect-wrap">     <h2>Select Redirect Page</h2>     <p>If selected, user will be redirected after form submission.</p>     <select name="cf7_redirect_page">         <option value="" <?php selected($selected_page, ''); ?>>     ...

coming soon

 <!DOCTYPE html> <html> <style> body, html {   height: 100%;   margin: 0; } .bgimg {   background-image: url('https://images.pexels.com/photos/1456291/pexels-photo-1456291.jpeg?_gl=1*pn8btp*_ga*MTA5NjgxNTcwMi4xNzcyOTEwNzMw*_ga_8JE65Q40S6*czE3NzI5MTA3MjkkbzEkZzEkdDE3NzI5MTA3MzMkajU2JGwwJGgw');   height: 100%;   background-position: center;   background-size: cover;   position: relative;   color: white;   font-family: "Courier New", Courier, monospace;   font-size: 25px; } .topleft {   position: absolute;   top: 0;   left: 16px; } .bottomleft {   position: absolute;   bottom: 0;   left: 16px; } .middle {   position: absolute;   top: 50%;   left: 50%;   transform: translate(-50%, -50%);   text-align: center; } hr {   margin: auto;   width: 40%; } </style> <body> <div class="bgimg">   <div class="topleft">     <p...

React Native / Expo Environment Setup on Ubuntu

1. Install Node.js Install Node.js from the official website using curl . Example: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs Verify installation: node -v npm -v 2. Install npm (if not installed) sudo apt install npm 3. Install Java (OpenJDK 17) React Native requires Java for Android development. sudo apt-get install openjdk-17-jdk sudo apt-get install openjdk-17-jre Verify: java -version 4. Install Watchman Watchman helps detect file changes for React Native projects. sudo apt install watchman Verify: watchman --version 5. Install Android Studio Download Android Studio. Extract it into the root directory / . Example: sudo tar -xvf android-studio-*.tar.gz -C / Navigate to the bin folder : cd /android-studio/bin Run Android Studio: ./studio.sh Complete the Android SDK setup from the Android Studio wizard. 6. Configure Android Environment Variables Open the .bashrc file: gedit ~/.bashrc Add the following lines at the end of the file : ex...

changes into code

sudo apt install poppler-utils pandoc unoconv ocrmypdf libreoffice ===================== sudo chown -R www-data:www-data /var/www/html/merger/ sudo chmod -R 755 /var/www/html/merger/ sudo chmod -R 777 /var/www/html/merger/uploads/ sudo chmod -R 777 /var/www/html/merger/merged/ sudo chmod -R 777 /var/www/html/merger/temp/