Skip to content

Instantly share code, notes, and snippets.

View nd3w's full-sized avatar

nd3w

View GitHub Profile
@nd3w
nd3w / slims-9.6.1-disable-member.md
Last active October 18, 2024 02:47
Disabling SLiMS v9.6.1 Member Section

How to Disable SLiMS v9.6.1 Member Section (Redirect to Home)

Backup your SLiMS directory first.

File /template/default/index_template.inc.php

Line number 42, change:

include 'parts/_member.php';
@nd3w
nd3w / batch-convert-png-to-jpg.txt
Created July 4, 2024 14:50
Shell script to batch convert PNG to JPG
#!/bin/bash
#convert
for image in *.png; do
convert "$image" -quality 80 "${image%.png}.jpg"
echo “$image converted to ${image%.png}.jpg ”
done
exit 0
@nd3w
nd3w / postgres-commands.md
Last active July 4, 2024 00:47
Some essential PostgreSQL commands

List databases:

\l

Use a database:

\c db_name

Use schema other than default 'public':

@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 / 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 / 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-to-excel.md
Last active March 24, 2023 14:33
Export MySQL data to Excel file using phpSpreadsheet according Chat GPT

To export data from MySQL to Excel using phpSpreadsheet, you can follow the steps below:

  1. Connect to the MySQL database using PHP.
    $servername = "localhost";
    $username = "yourusername";
    $password = "yourpassword";
    $dbname = "yourdbname";

    // Create connection
@nd3w
nd3w / install-a-laravel-app-into-a-shared-hosting-per-openai.md
Last active March 20, 2023 03:20
Install a Laravel App into a Shared Hosting per OpenAI

Install a Laravel App into a Shared Hosting per OpenAI

When I asked ChatGPT how do I deploy a Laravel app into a shared hosting, here's its answer:

Here are the general steps to follow in order to install a Laravel application into a shared hosting:

  1. Prepare the Laravel Application: First, you need to prepare your Laravel application for deployment by running the following commands in your terminal:
composer install --optimize-autoloader --no-dev