Skip to content

Instantly share code, notes, and snippets.

@TheAhmedGad
TheAhmedGad / utf8_arabic_ci.md
Last active August 14, 2024 17:35
Add Arabic utf8 arabic case insensitive Collation to MYSQL ENGINE

Support Arabic CI Collation

To make mysql understand Arabic letters synonyms like "أ" and "إ"

  • Run This to get Collation Path SHOW VARIABLES LIKE 'character_sets_dir';

  • in /collation/path/Index.xml add this to <charset name="utf8"> section

@lynt-smitka
lynt-smitka / .htaccess
Last active August 12, 2024 09:18
Block hidden files except .well-known - Apache .htaccess + Nginx
RewriteRule "(^|/)\.(?!well-known\/)" - [F]
@nickrouty
nickrouty / rd-class-text-extraction.php
Created May 9, 2018 04:14
Class for extraction the text from doc, docx, xlsx, pptx and wrapper for 3rd party pdf to text library.
<?php
/**
* Class RD_Text_Extraction
*
* Example usage:
*
* $response = RD_Text_Extraction::convert_to_text($path_to_valid_file);
*
* For PDF text extraction, this class requires the Smalot\PdfParser\Parser class.
@alexjlockwood
alexjlockwood / .block
Last active February 15, 2022 10:01
Radial Dendrogram
license: gpl-3.0
border: no
height: 900
@ChiranjeeviAdi
ChiranjeeviAdi / dbconnect.php
Last active November 1, 2024 17:04
(Datatables) Server Side Pagination using PHP,MYSQL,Jquery
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "testusersdb";
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
@Guibzs
Guibzs / .htaccess
Last active March 26, 2023 15:17
Symfony 4 ~ .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
@anunay
anunay / dump-database.sh
Last active November 7, 2024 14:05
MYSQL : Dump database with procedures, functions, views & triggers.
#Export database with all procedures, functions, views & triggers along with the table structures and their data.
mysqldump <other mysqldump options> --routines export.sql
@HoangPV
HoangPV / session_example_config.php
Last active May 19, 2021 16:26
PHP MySQL Login System
<?php
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'Hoang123');
define('DB_NAME', 'session_example');
define('DB_SERVER', 'localhost');
/* Attempt to connect to MySQL database */
/** @var mysqli $mysqli */
$mysqli = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
function genScreenshot() {
var canvasImgContentDecoded;
html2canvas(document.body, {
onrendered: function(canvas) {
window.canvasImgContentDecoded = canvas.toDataURL("image/png");
}
});
}
genScreenshot();
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active March 25, 2025 08:05
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com