Author: rudy

  • Practice bit manipulation with Tic Tac Toe and PHP

    Introduction: Tic Tac Toe is a fun game that you’ve probably played before. But did you know there are secret codes hidden inside the game? In this post, we’ll uncover these secret codes and learn how they can help you become a Tic Tac Toe master! Understanding Secret Codes: Before we dive into Tic Tac…

  • Capturing Microphone Input in the Browser and Streaming to Icecast

    To capture audio from the microphone in a browser and stream it to an Icecast server, you can use Web Audio API and a streaming library. Here’s an example using the mic-stream library for simplicity: Step 1: HTML Create an HTML file (index.html) with the following content: Step 2: JavaScript Create a JavaScript file (stream.js)…

  • Setup Icecast with PHP

    Setting up multiple audio streams using Icecast in PHP requires a combination of server-side and client-side code. Below, I’ll provide a simple example of how you can set up a basic Icecast server with multiple streams and a PHP script to stream audio from the microphone using the Icecast source client, ices. Step 1: Install…

  • Laravel-Tagging vs Laravel-Tags: A Tagging Package Comparison

    Feature laravel-tagging laravel-tags Installation Requires composer require rtconner/laravel-tagging Requires composer require spatie/laravel-tags Namespace Conner\Tagging Spatie\Tags Trait for Models Taggable HasTags Adding Tags $model->tag(‘tag1, tag2, tag3’); $model->attachTags([‘tag1’, ‘tag2’]); Retrieving Models by Tag $models = YourModel::withAnyTag([‘tag1’, ‘tag2’])->get(); $models = YourModel::withAllTags([‘tag1’, ‘tag2’])->get(); Removing Tags $model->untag(‘tag1’); $model->detachTags([‘tag1’]); Getting Tags for a Model $tags = $model->tags; $tags = $model->tags; Tag…

  • TIL: Cool nerds on the Internet

    https://filiph.net who made Year Progress. https://www.fiveoutofnine.com who made chess on EVM.

  • Optimizing WooCommerce x FacetWP Search for Title and Tag Precision

    Problem In the world of e-commerce, having an effective search system is crucial. For WooCommerce stores utilizing FacetWP search, ensuring precision in search results enhances the user experience. Suppose you want to search for the keyword “sunset” and only see products with that word in their title. Additionally, you want products tagged with “sunset” to…

  • Database grow

    After 1 year 2 months running, my website is growing fast. I’ve done a WP-CLI search-replace command today and got this result: That is an impressive number for me. So I write it here to make a milestone.

  • How to remove .w3-cache malware from WordPress website

    My website has been infected by a malware that spamming my traffic. This is what was happened to my website: Traffic from France with Agent named contains ahrefs.com Bandwidth is up to 1.7 GB a day Some weird folders have been appeared automatically like: wp-content/uploads/.w3-cache Malware code has been added to wp-config.php, wp-content/themes/current-themes/index.php Actions Follow…

  • SQLSTATE[HY000]: General error: 1 no such table: cache

    If you got this error while setting up Laravel application. Try to remove the line cache_driver=database in your .env file. Or create cache table for your application.

  • Setup letsencrypt with Laradock

    in docker-compose.yml set $CN and $EMAIL with your data: in docker-compose.yml add the volumes used in certbot: Make sure port 443 is disabled in your laradock/nginx/sites/xxx.conf stop nginx container docker-compose stop nginx rebuild nginx container with –no-cache option docker-compose build –no-cache nginx build certbot container docker-compose build –no-cache certbot start nginx container docker-compose up -d…