This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | NGINX - PHP | |
| yum install nginx | |
| yum install php5.6 or 7.0 | |
| yum install php56-fpm or php7-fpm | |
| edit /etc/nginx/conf.d/default.conf | |
| server { | |
| listen 80; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| #map { | |
| height: 400px; | |
| width: 100%; | |
| } | |
| </style> | |
| </head> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | try { | |
| $pdo = new PDO("mysql:host=localhost; dbname=dbname", 'user', 'password', array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'")); | |
| $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| } catch (PDOException $e) { | |
| echo 'Connection failed: ' . $e->getMessage(); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function loadProgressBar($current, $total, $max_progress = 50) { | |
| $percentage = number_format((float) ($current / $total) * 100, 2); | |
| $progress_ctr = floor($max_progress * ($percentage / 100)); | |
| $progress_bar = floor($max_progress * ($percentage / 100)) < 1 ? str_repeat("=", 1) . str_repeat(" ", $max_progress - 1) : str_repeat("=", $progress_ctr) . str_repeat(" ", $max_progress - $progress_ctr); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| host="ip_address" | |
| dbname="dbname" | |
| user="dbuser" | |
| password="dbpass" | |
| path=/directory/path | |
| date=$(date +"%Y%m%d") | |
| mysqldump --host=$host --user=$user --password=$password -v $dbname > $path/$dbname-$date.sql | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| date=$(date +"%Y%m" -d "-1 month") | |
| day=$(date +"%d") | |
| path=/path/to/your/source | |
| sync_path=/your/destination | |
| password="yourpassword" | |
| cd $path | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| class Singleton { | |
| public static $instance = null; | |
| private function __construct() { | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| final class Container { | |
| private static $instance = null; | |
| private $services = array(); | |
| private function __construct() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function hook($method, &...$params) { | |
| $function_list = get_defined_functions()['user']; | |
| foreach ($function_list as $func) { | |
| $pattern = '/.*\_' . $method . '|' . $method . '/'; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | .git/ | |
| cache/ | |
| _*cache/ | |
| cache*/ | 
NewerOlder