Skip to content

Instantly share code, notes, and snippets.

@nd3w
nd3w / xfce-panel-icon-size.md
Last active May 7, 2024 00:29
How to change XFCE panel's of notify and audio icon size

This is a way to change notify and audio icon size for XFCE panel:

Create or edit ~/.config/gtk-3.0/gtk.css, and add these two selectors:

#pulseaudio-button * {
        -gtk-icon-transform: scale(.55);
}

#xfce4-notification-plugin * {
@nd3w
nd3w / vscode_ref.md
Last active April 15, 2024 03:36
VSCode Ref

Search and Replace

Search and replace PHP variable in if control structure using regex:

if \(isset\(\$([a-zA-Z_]+)\)\) \{

Replace pattern

if (isset($$$1) AND $$$1 !== '') {
@nd3w
nd3w / keyboard-shortcuts-in-linux-mint-cinnamon.md
Last active April 9, 2024 13:56
Keyboard Shortcuts in Linux Mint Cinnamon

Move a window to another workspace

Press Ctrl+Alt+Shift Left or Ctrl+Alt+Shift Right

Move a window to another monitor

Press Super+Shift Left or Super-Shift Right

Move active window around on the desktop

@nd3w
nd3w / install-nginx-mariadb-phpfpm-on-ubuntu-20.04.md
Last active April 8, 2024 10:28
How to Install Nginx, MariaDB, PHP-FPM on Ubuntu 20.04

How to Install Nginx, MariaDB, PHP-FPM on Ubuntu 20.04

This is a way to install and set up Nginx, MariaDB and PHP-FPM on Ubuntu 20.04.

NOTE: This has been prepared for ease of use in mind, not security, mostly in development machine. Please do not use these instructions to setup on a public server environment. Use other proper manuals instead.

$ sudo apt update

Nginx

@nd3w
nd3w / linux-commands.txt
Last active April 2, 2024 07:40
A Collection of Useful Linux Commands
Backup with bunzip
tar cvfj file.tar.bz2 *
tar cvfj file.tar.bz2 /path/to/directory_to_backup/
Extract from bunzip to directory 'archive'
tar -xvf archive.tar.bz2 ./
Compress multi directories into each own compressed files
for i in */; do zip -r "${i%/}.zip" "$i"; done
for i in */; do tar -czvf "${i%/}.tar.gz" "$i"; done
@nd3w
nd3w / php-snippets.md
Last active March 15, 2024 15:45
PHP Snippets

Dump all PHP variables

$all_vars = get_defined_vars();
print_r($all_vars);

Create an array for a range (e.g: array with number from 1 to 9)

$number = 9;

for ($i = 1; $i <= $number; ++$i) {

@nd3w
nd3w / install-lapp-ubuntu-20.04.md
Last active December 11, 2023 04:00
Install Apache2, PostgreSQL and PHP-FPM on Ubuntu 20.04

Install Apache2, PostgreSQL and PHP-FPM 8.2 on Ubuntu 20.04

Install Apache

sudo apt install apache2

sudo ufw app list

sudo ufw allow in "Apache"
@nd3w
nd3w / LibreOfficeCalcFormulasAndTips.md
Last active June 14, 2023 12:51
LibreOffice Calc Formulas and Tips

Calculate average value from B2 to B32 with B24 to B32 are blanks:

=SUM(B2:B32)/(ROWS(B2:B32)-COUNTBLANK(B2:B32))

or simply:

=AVERAGE(B2:B32)
@nd3w
nd3w / javascript-to-check-double-click.md
Last active May 20, 2023 00:44
JavaScript to check for double click
<input type="submit" name="value(submit)" value="Continue" onDblClick="fncDoubleOut();">
<input type="button" name="value(submit)" value="Cancel" onclick="cancel_onclick();" onDblClick="fncDoubleOut();">
function fncDoubleOut(){
   alert('Your transaction is being processed. Thank you.');
   return false;
}
@nd3w
nd3w / mysql-queries.md
Last active April 3, 2023 08:23
Collection of useful MySQL queries

List of table's names only

SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='db name' 
    AND `TABLE_NAME`='table name';

Select all rows with the same value

SELECT e1.*