I hereby claim:
- I am aldodelgado on github.
- I am aldodelgado (https://keybase.io/aldodelgado) on keybase.
- I have a public key ASBOuV8_KRT-oAW4VGzX45pjJlaz3MoSF-WHuN-l7siQaQo
To claim this, I am signing this object:
| # Keep code struture in models consistent | |
| # Inspired by http://rails-bestpractices.com/posts/75-keep-code-struture-in-models-consistent | |
| # One example: (From top to bottom) | |
| associations | |
| scopes | |
| class methods | |
| validates | |
| callbacks | |
| instance methods |
| #!/bin/bash | |
| # Downloads the MVPS hosts file, and append it to the system hosts file | |
| # | |
| # If you want to make any manual persistent changes to the system hosts | |
| # file, run this script first, then make sure that the change is backed up to | |
| # /etc/hosts.orig. | |
| if [ "$(whoami)" != "root" ]; then | |
| echo "Sorry, this script must be run as root." |
| #!/bin/bash | |
| # Shell script to backup MySql database | |
| # To backup Nysql databases file to /backup dir and later pick up by your | |
| # script. You can skip few databases from backup too. | |
| # For more info please see (Installation info): | |
| # http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html | |
| # Last updated: Aug - 2005 | |
| # -------------------------------------------------------------------- | |
| # This is a free shell script under GNU GPL version 2.0 or above | |
| # Copyright (C) 2004, 2005 nixCraft project |
| <?php | |
| require('restclient.php'); | |
| class Edocgen { | |
| private $api = ''; | |
| private $results = ''; | |
| private $response = ''; | |
| function __construct() { |
| <?php | |
| # Database Connection | |
| $link = mysqli_connect("SERVER", "DB_USER", "DB_PSSWORD", "DB_NAME"); | |
| # Checks to see if the database connection was made | |
| if (!$link) { | |
| echo "Error: Unable to connect to MySQL." . PHP_EOL; | |
| echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; | |
| echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; |
| <?php | |
| function xss_whitelist($input, $limit = null, $offset = 0) { | |
| // Force input to be a string0 | |
| $x = (string) $input; | |
| // Allow alphanumeric characters, whitespace, and specific characters | |
| $x = preg_replace("/[^a-zA-Z0-9 -:,.!?\/|]/", "",$x); | |
| // Limit characters |
| <?php | |
| $username = ''; | |
| $password = ''; | |
| // A higher "cost" is more secure but consumes more processing power | |
| $cost = 10; | |
| // Create a random salt | |
| $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| /** | |
| * PHP REST Client | |
| * https://github.com/tcdent/php-restclient | |
| * (c) 2013-2017 Travis Dent <tcdent@gmail.com> | |
| */ | |
| class RestClientException extends Exception {} |