This file contains 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
cd ~ | |
sudo apt-get update | |
1. Install PHP and Nginx | |
#apt-get install software-properties-common | |
sudo apt-get -y install nginx php7.0 php7.0-fpm php7.0-mbstring php7.0-xml git composer | |
2. Config Nginx |
This file contains 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
Axios.interceptors.request.use(function (config) { | |
const session = JSON.parse(localStorage.getItem('session')); | |
config.headers['X-Token'] = session ? `${session.token}` : ''; | |
return config; | |
}); | |
Axios.interceptors.response.use((response) => { // intercept the global error | |
return response | |
}, function (error) { | |
if (error.response.status === 401) { // if the error is 401 and hasent already been retried |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Nuevo Contacto</title> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
</head> | |
<body> |
This file contains 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 | |
# Name: listusers.bash | |
# Purpose: List all normal user and system accounts in the system. Tested on RHEL / Debian Linux | |
# Author: Vivek Gite <www.cyberciti.biz>, under GPL v2.0+ | |
# ----------------------------------------------------------------------------------- | |
_l="/etc/login.defs" | |
_p="/etc/passwd" | |
## get mini UID limit ## | |
l=$(grep "^UID_MIN" $_l) |
This file contains 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 defer_js_async($tag){ | |
// scripts to defer. | |
$scripts_to_defer = array('script-name1.js', 'script-name2.js', 'script-name3.js'); | |
// scripts to async. | |
$scripts_to_async = array('script-name1.js', 'script-name2.js', 'script-name3.js'); | |
foreach($scripts_to_defer as $defer_script){ |
This file contains 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
#Fuente: http://blog.intropedro.com/es/content/activar-la-compresi%C3%B3n-gzip-en-apache-httpd | |
LoadModule deflate_module modules/mod_deflate.so | |
<IfModule mod_deflate.c> | |
# Activamos la compresión | |
SetOutputFilter DEFLATE | |
# Indicamos los tipos de contenido a comprimir |
This file contains 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
Source: https://snipt.net/danfreak/backup-and-restore-all-mysql-databases-with-2-simple-commands/ | |
#backup all databases in one file (eventually add the option --add-locks): | |
mysqldump -u username -p -–all-databases > file.sql | |
#backup all databases in one gzipped file: | |
mysqldump -u username -p -–all-databases | gzip > file.sql.gz | |
#restore all databases: | |
mysql -u username -p < file.sql |
This file contains 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/Windows runs as a standard console application (not a service), and it can be managed using the following commands: | |
nginx -s stop fast shutdown | |
nginx -s quit graceful shutdown | |
nginx -s reload changing configuration, starting new worker processes with a new configuration, graceful shutdown of old worker processes | |
nginx -s reopen re-opening log files |
This file contains 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
/** | |
*@title Array.joinWith - shim by Joseph Myers 7/6/2013 | |
*@href http://stackoverflow.com/questions/17500312/is-there-some-way-i-can-join-the-contents-of-two-javascript-arrays-much-like-i | |
*@notes: shim de javascript para hacer o emular "inner join" entre dos arrays de objetos | |
* */ | |
if (!Array.prototype.joinWith) { | |
+function () { | |
Array.prototype.joinWith = function(that, by, select, omit) { |
This file contains 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
{ | |
"mexico":{ | |
"estado":[ | |
{ | |
"id":1, | |
"iso":"MX-AGS", | |
"capital":"Aguascalientes", | |
"nombre":"AGUASCALIENTES", | |
"municipios":{ | |
"municipio":[ |