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 | |
// Create a copy of this file as local-config.php | |
// and define the required constants | |
define('DB_NAME', 'some_prefix_'. $requested_site); | |
define('DB_USER', 'somecleverusername'); | |
define('DB_PASSWORD', 'someawesomesupersecretpassword'); | |
define('DB_HOST', 'localhost'); | |
define('DOMAIN_CURRENT_SITE', $requested_site .'.main-site.com' ); |
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
# from http://stackoverflow.com/a/9360947/1182872 | |
for x in `mysql -u [username] -p[password] [db name] -e 'show tables'`; do mysqldump -u [username] -p[password] [db name] $x > "$x.sql"; done |
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
# Ingresa al directorio donde quieres clonar el repositorio; por ejemplo | |
cd /var/www/mi-proyecto | |
# Clona el repositorio en un nuevo directorio bajo el que deseas reutilizar, de modo que quede /var/www/mi-proyecto/repositorio-git | |
git clone [email protected]:felipelavinz/mi-proyecto.git repositorio-git | |
# Mueve los directorios (y archivos, si es necesario) ya existentes en el proyecto antiguo y que también existen en el repositorio. | |
# Si en el primer nivel de tu proyecto sólo tienes directorios y no muchos archivos sueltos es más fácil | |
# Por ej; en el primer nivel siempre tengo los directorios ddbb y htdocs (y otros si es necesario) para tener todo más ordenado | |
mv htdocs htdocs-backup && mv ddbb ddbb-backup |
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 | |
/** | |
* Valida y formatea RUT en distintos formatos. | |
* Esta clase considera que los RUT son manejados como sólo una cadena de texto, es decir, | |
* incluye SIEMPRE el digito verificador. | |
* | |
* @author Esteban Martini Muñoz | |
* @version 1.0 | |
* |
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 | |
// indicar los namespace que se utilizarán | |
use Elastica; | |
use Elastica\Query; | |
use Elastica\Exception; | |
$results = null; | |
try { |
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 | |
$timezone = new DateTimeZone('America/Santiago'); | |
$now = new DateTimeImmutable('now', $timezone ); | |
$dds = $now->format('N'); | |
switch ( $dds ){ | |
// sabado | |
case 6: |
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 | |
/** | |
* Set or explore post term associations | |
* | |
* @author Felipe Lavín Z. <[email protected]> | |
*/ | |
class Post_Term extends \WP_CLI_Command{ | |
/** | |
* Add a term to a post |
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
.cf:before, | |
.cf:after { | |
content: " "; /* 1 */ | |
display: table; /* 2 */ | |
} | |
.cf:after { | |
clear: both; | |
} |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Most Commented</title> | |
<link rel="stylesheet" href="https://raw.github.com/necolas/normalize.css/master/normalize.css" type="text/css"> | |
<style type="text/css"> | |
/* Sus estilos */ | |
body{ | |
background: #141414; |
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 lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Z-Index</title> | |
<style> | |
body{ | |
font-family: sans-serif; | |
} | |
figure, img{ |