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
// Generate UUID v4 | |
function generateUuidv4() | |
{ | |
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', | |
// 32 bits for "time_low" | |
mt_rand(0, 0xffff), mt_rand(0, 0xffff), | |
// 16 bits for "time_mid" | |
mt_rand(0, 0xffff), | |
// 16 bits for "time_hi_and_version", | |
// four most significant bits holds version number 4 |
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
# Deny all attempts to access hidden files/folders such as .git, .htaccess, .htpasswd, .DS_Store (Mac), etc... | |
location ~ /\. { | |
deny all; | |
access_log off; | |
log_not_found off; | |
} | |
# Deny yaml, twig, markdown, ini file access | |
location ~* /.+\.(markdown|md|twig|yaml|yml|ini)$ { | |
deny all; |
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> | |
<head> | |
<title>API Docs with Swagger UI</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.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
{ | |
"editor.rulers": [80,120], | |
"workbench.colorCustomizations": { | |
"editorRuler.foreground": "#ff4081" | |
} | |
} |
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
#--------------------------------------------------------------------------------------------------# | |
# ENVIRONMENT SETTING # | |
# It can be anything, but "development", "staging" and "production" are supported out of the box. # | |
# Do not use "development" on production and viceversa, because it has effect on debug settings. # | |
#--------------------------------------------------------------------------------------------------# | |
WORDPRESS_ENV=development | |
#--------------------------------------------------------------------------------------------------# | |
# DEBUG # | |
# If you set WORDPRESS_ENV, default debug values are used based on that. # |
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
"use strict"; | |
/* | |
Example Hyper Config | |
@link https://hyper.is#cfg for all currently supported options. | |
*/ | |
module.exports = { | |
config: { | |
updateChannel: 'stable', | |
fontSize: 17, | |
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', |
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
#How to convert yyyy-MM-ddTHH:mm:ssZ to yyyy-MM-dd HH:mm:ss | |
date_default_timezone_set("America/Lima"); | |
echo date('Y-m-d H:i:s', strtotime('2012-09-10T10:30:00Z'));//date format UTC +00.00 | |
#convert date format UTC to timezone America/Lima | |
date_default_timezone_set("UTC");//server configured UTC | |
$date = strtotime(date('Y-m-d H:i:s')); | |
echo(date_default_timezone_get() . "<br />");//output: UTC |
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 | |
declare(strict_types = 1); | |
/** | |
* ConfusionMatrix | |
* | |
* @author Gonzalo Chacaltana Buleje <gchacaltanab@outlook.com> | |
* @version v1.0.0 | |
* @access public | |
*/ |
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
# Función que devuelve wordcloud de un contenido de texto | |
# @param Corpus corpus Example: Corpus(VectorSource(publication)) from Corpus Package | |
wordcloud_corpus <- function(corpus) { | |
# Matriz de términos (Term-Document-Matrix) | |
tdm = TermDocumentMatrix(corpus, control = list(removePunctuation = TRUE, removeNumbers = TRUE, tolower = TRUE)) | |
matrix_tdm = as.matrix(tdm) | |
# Obtenemos las palabras frecuentes de mayor a menor | |
words_freqs = sort(rowSums(matrix_tdm), decreasing=TRUE) | |
NewerOlder