Skip to content

Instantly share code, notes, and snippets.

@xmsi
xmsi / database_knowledgebase.md
Last active April 12, 2025 07:06
Database theory

MYSQL

Export from docker

mysqldump -u root -p database_name --skip-comments > my_export_file.sql

Import from docker

mysql -u root -ppassword db_name < /tmp/database.sql

@xmsi
xmsi / excel_formulas_xmsi.md
Created April 11, 2025 10:02
Excel folmulas

Excel Filter

=FILTER(B1:B661, B1:B661<>"")

filter and get only not empty values from 1-661 raws

@xmsi
xmsi / windows_xmsi.md
Created March 21, 2025 16:41
Windows

How to format and clean usb flash in Windows

  1. Powershell ->
  2. diskpart

  3. list disk

  4. select disk

  5. clean

  6. create partion primary

  7. format fs=ntfs

@xmsi
xmsi / Larahelper.md
Last active March 18, 2025 05:51
Helper for Laravel

Sail

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install
@xmsi
xmsi / Php_xmsi.md
Last active March 6, 2025 05:51
Code sheat

Null Coalescing (??) vs Ternary (?:) operators

  • Null coalescing - check for null and performs next (?? ??=)
  • Ternary - check for false and performs next (?:)

Testing

Functional and Unit testing

  • Functional tests only in and out. Your soft becomes black-box, it kind of user behavior simulation
@xmsi
xmsi / docker.md
Last active March 5, 2025 09:28
Docker helper

Docker Engine, Compose, Portainer on Ubuntu 22

Docker Engine, Compose and Portainer installation on ubuntu 22. Optional: how to change default docker root folder (where images and containers are stored)

Install docker engine

tutorial video tested it works To install on Ubuntu 22 you should type these commands in your CLI

  1. $ curl -fsSl https://get.docker.com -o get-docker.sh
  2. $ sudo sh get-docker.sh
  3. $ sudo groupadd docker
@xmsi
xmsi / Versioning.md
Last active February 21, 2025 06:46
Packages Versioning in composer.json, PHP

There is a difference between ~ and ^ in Composer, though it might not be immediately obvious in some cases. Let me clarify:

Key Difference Between ~ and ^:

  • ~ (tilde): Allows updates for the last digit specified.
  • ^ (caret): Allows updates for all minor versions within the same major version.

In your example, ~7.3 vs. ^7.3:

  • ~7.3:
@xmsi
xmsi / movedns_xmsi.md
Created February 18, 2025 10:33
Move DNS domain from hostinger to digitalOcean

How to move domain from Hostinger to DigitalOcean

  1. I couldn't use CNAME for root domain (it doesn't works), so decided to get all dns names from hostinger to digitalOcean
  2. Also you should configure email profiles in Hostinger:
  3. Go to the DigitalOcean Control Panel and navigate to the Networking section.
  4. Select your domain to view and edit its DNS records. Add dns records. These records can be seen from Hostinger's Email management section.
@xmsi
xmsi / git.md
Last active January 16, 2025 07:16
Git helper

Undo pushed Merge request

  1. git log --oneline see to which commit you need to jump
  2. git reset --hard branch_hash
  3. git push origin feature/DATRUECALL-180 --force force push branch to remote origin

It is better to pull from origin before doing massive changes

Server certificate verification failed CAfile: