Skip to content

Instantly share code, notes, and snippets.

@lincheyu
lincheyu / phpmyadmin.conf
Created April 19, 2025 01:25 — forked from irgendwr/phpmyadmin.conf
Nginx snippet for serving phpmyadmin in a custom subdirectory
location /pma {
alias /usr/share/phpmyadmin;
try_files $uri $uri/ @pma =404;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; # <-- change this to fit your installation
}
}
@lincheyu
lincheyu / rest-api-response-format.md
Created March 17, 2025 10:34 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@lincheyu
lincheyu / strong-passwords.php
Created March 28, 2019 06:52 — forked from tylerhall/strong-passwords.php
A user friendly, strong password generator PHP function.
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
@lincheyu
lincheyu / VideoStream.php
Created November 14, 2018 07:06 — forked from ranacseruet/VideoStream.php
PHP VideoStream class for HTML5 video streaming
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";