Skip to content

Instantly share code, notes, and snippets.

@suiramus
suiramus / config_smtp_wordpress.php
Last active November 19, 2023 15:22
Wordpress SMTP without plugin
<?php
// wp-config.php
// SMTP email settings
// https://developer.wordpress.org/reference/hooks/phpmailer_init/
define( 'SMTP_USERNAME', 'web@yoursite.com' );
define( 'SMTP_PASSWORD', 'your_password' );
define( 'SMTP_SERVER', 'mail.yoursite.com' );
define( 'SMTP_FROM', 'web@myoursite.com' );
@suiramus
suiramus / .+instruction.txt
Last active September 12, 2023 17:45
XAMPP SSL Generator, VirtualHost and .htaccess
1. In directorul xampp creaza un director "ssl-certificat-generator"
C:\xampp\apache\ssl-certificat-generator
2. In interiorul "ssl-certificat-generator" creeaza doua fisiere:
- cert.conf [Search and replace: mysite.loc with your domain [4 times]]
- make-cert.bat [deschide pentru a genera certificatul si cheia. Se creeaza automat un director cu numele mysite.loc. Cerificatul si cheia se pot muta in directorul siteului. In acest caz, trepbuie specificata calea in httpd-vhost.conf]
Install Certificate -> Store Location [Current User] -> Place All Certificate in the following store -> Trustet Root Certification Authorities
3. In C:\xampp\apache\conf\extra\httpd-vhosts.conf adauga un nou virtual host
Verifica calea catre site
@suiramus
suiramus / apache_singlePort_multiHost_httpd-vhosts.conf.md
Created September 3, 2023 07:29 — forked from adojos/apache_singlePort_multiHost_httpd-vhosts.conf.md
XAMPP | Apache: Config for 'httpd-vhosts.conf' Implementing single-port and multi-virtualHosts [Part 3 of 4]

[Part 3 of 4] Apache Single-Port & Multi-Host 'httpd-vhosts.conf'


In order to have a multi-port configuration for different virtual hosts (projects, websites) on Apache in XAMPP, you need to make changes to the following 3 Apache configuration files and 1 windows host file:

1. httpd.conf (\XAMPP\apache\conf)

2. httpd-ssl.conf (\XAMPP\apache\conf\extra)

@suiramus
suiramus / imagedir.php
Created July 16, 2023 10:24
Image dir to PHP array
<?php
// Scaneaza un director cu imagini
// Obtine informatii despre imagini
// Listeaza informatiile ca array gata de prelucrat
// 2023.05.10
$directory = 'lucrari-big'; // Calea către directorul dorit
// Verificăm dacă directorul există
@suiramus
suiramus / directory-image-scan.php
Created May 10, 2023 12:49
Scaneaza un director cu imagini si obtine informatii despre fiecare imagine.
<?php
// Scaneaza un director cu imagini
// Obtine informatii despre imagini
// Listeaza informatiile ca array gata de prelucrat
// 2023.05.10
$directory = 'images/image-directory'; // Calea către directorul dorit
// Verificăm dacă directorul există
@suiramus
suiramus / web-dev-resources.md
Last active March 10, 2023 13:34
Web Development Resources +

Software

Cyotek WebCopy

https://www.cyotek.com/cyotek-webcopy
Cyotek WebCopy is a free tool for automatically downloading the content of a website onto your local device.


Color Tools

Cyotek Color Palette Editor

@suiramus
suiramus / debug-scroll.md
Created March 9, 2023 09:59 — forked from cuth/debug-scroll.md
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right &gt; w || b.left &lt; 0) {
@suiramus
suiramus / 503.html
Created February 12, 2023 12:38
503 error custom page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maintenance</title>
<style>
* {box-sizing: border-box; margin: 0;}
body {
font-family: 'Roboto', Arial, sans-serif;
@suiramus
suiramus / .htaccess
Created February 12, 2023 12:36
htaccess custom 503 error page
ErrorDocument 503 /503.html
RewriteEngine On
# Excluded IP
RewriteCond %{REMOTE_ADDR} !^111.111.111.111$
RewriteCond %{REQUEST_URI} !.(css|gif|ico|jpg|js|png|swf|txt)$
# RewriteRule .* - [R=503,L]
RewriteRule .* 503.html [L]
@suiramus
suiramus / new-admin-wp-from-ftp.php
Last active January 25, 2023 10:46
Create a new admin user in WP from FTP access
<?php
/*
Plugin Name: Create a new admin user in WP from FTP access
Plugin URI: https://www.example.com
Description: If you have ftp access you can create an admin user for yourself.
Author: Name
Version: 0.1
*/
/*