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
const env = (key, defaultValue = null) => { | |
const value = process.env[key] ?? defaultValue; | |
switch (String(value).toLowerCase()) { | |
case 'true' || '(true)': | |
return true; | |
case 'false' || '(false)': | |
return false; | |
case 'empty' || '(empty)': | |
return ''; | |
case 'null' || '(null)': |
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
$ch = curl_init(); | |
$options = [ | |
CURLOPT_RETURNTRANSFER => true, // return web page | |
CURLOPT_HEADER => false, // don't return headers | |
CURLOPT_FOLLOWLOCATION => true, // follow redirects | |
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects | |
CURLOPT_ENCODING => "", // handle compressed | |
CURLOPT_USERAGENT => "test", // name of client | |
CURLOPT_AUTOREFERER => true, // set referrer on redirect |
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
$png = 'image/path/filename.png'; | |
$img = imagecreatefrompng($png); | |
//find the size of the borders | |
$b_top = 0; | |
$b_btm = 0; | |
$b_lft = 0; | |
$b_rt = 0; | |
//top |
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
/** | |
* With axios agent | |
*/ | |
axios({ | |
url: 'url', | |
method: 'POST', | |
responseType: 'blob' | |
}).then(res => { | |
const fileURL = URL.createObjectURL(res.data); | |
window.open(fileURL); |
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
await this.$axios({ | |
url: 'apiurl', | |
method: 'POST', | |
responseType: 'blob', | |
data: payload | |
}).then(res => { | |
const fileURL = URL.createObjectURL(res.data); | |
window.open(fileURL); | |
}) |
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
<template> | |
<div> | |
<q-input | |
:outlined="outlined" | |
:dense="dense" | |
:filled="filled" | |
:class="inputClass" | |
:label="label" | |
:value="value" | |
mask="##/##/####" |
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
<template> | |
<div> | |
<div v-if="!loading"> | |
<input | |
type="text" | |
:class="inputClass" | |
:placeholder="placeholder" | |
v-model="terms" | |
@focus="resetStatus" |
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 | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
require 'vendor/phpmailer/phpmailer/src/Exception.php'; | |
require 'vendor/phpmailer/phpmailer/src/PHPMailer.php'; | |
require 'vendor/phpmailer/phpmailer/src/SMTP.php'; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; |
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
const merged = [].concat.apply([], arrays) |
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
/** | |
* @param data Object[] Ej.: [{ nombre: Marcelo, apellido: Forclaz }] | |
* @param fields Array Ej.: ['nombre', 'apellido'] | |
* @param columns Array Ej.: ['Nombre', 'Apellido'] | |
* @param filename String Ej.: 'archivo.csv' | |
* */ | |
const generateCsv = (data, fields, columns, filename) => { | |
let csv = 'data:text/csv;charset=utf-8,' | |
csv += '"' + columnNames.join('","') + '"\n'; |
NewerOlder