Skip to content

Instantly share code, notes, and snippets.

@engelcituk
engelcituk / gist:42b4fd2691fa8b7f8ce6ac1db782cae0
Created October 20, 2021 17:27
Eliminar objetos repetidos en un array
let data = [
{
id: 1,
valor: 'mivalor'
},
{
id: 2,
valor: 'mivalore ree'
},
{
@engelcituk
engelcituk / tokens web
Created February 17, 2021 00:05
tokens
4a82903f00433c1f302343f806e8555a807d9cbc WebFivesClub
91cf383ddee0c430f4c7a901bb723312935bba94 Web_ThefivesExperiences
69e2331cf0fc5ebd3daae1748288facb5ac04dcf Web_Epictraveler
82a577c4822b981b568b8b28bfb2e0cf4c9b936d Web_Romarley
a655e29e2c02f6a8066e7bd961c621f6260abb5e Web_FivesRoof
246887fee91b1866633489059cb979e4b6c47601 web_marholidays
6f292a4810d10da360ab264cf6e6d36b7b4f8ded POS
https://itnext.io/vuidget-how-to-create-an-embeddable-vue-js-widget-with-vue-custom-element-674bdcb96b97
Este comando daba problemas al hacer el build
npm install webpack --save
Mejor desinstalar y reinstalar con
npm uninstall webpack
npm install webpack@^4.0.0 --save-dev
@engelcituk
engelcituk / seconds
Created February 12, 2021 23:37
Fecha a segundos con js
const date = new Date("2015-08-25T15:35:58.000Z");
const seconds = date.getTime() / 1000; //1440516958
@engelcituk
engelcituk / Errores de validacion, laravel, blade
Last active February 12, 2021 23:42
Errores de validacion, laravel, blade
En un campo en especifico:
<div class="col-lg-4 col-md-6 col-sm-12">
<div class="form-group">
<label>Nombre*</label>
<input type="hidden" name="id" id="id" value="{{$user->id}}">
<input type="text" class="form-control" id="name" name="name" autocomplete="off" value="{{$user->name}}" >
@if ($errors->has('name'))
<span class="text-danger">{{ $errors->first('name') }}</span>
@endif
@engelcituk
engelcituk / dates carbon
Last active January 28, 2021 22:09
Formatos de fecha con carbon en laravel
$date = Carbon::now();
echo $date->toDateString();
// 2020-06-22
echo $date->toDateTimeString();
// 2020-06-22 19:45:23
echo $date->toFormattedDateString();
// Jun 22, 2020
@engelcituk
engelcituk / instrucciones: Recontruir un proyecto laravel
Last active February 12, 2021 23:42
Recontruir un proyecto laravel
Una vez clonado nuestro proyecto, abriremos una terminal y nos situaremos en dicha carpeta. Una vez estando ahí ejecutaremos:
composer install
Generar el archivo .env, sí no existe el .env.example, bajar el ejemplo aquí:
https://github.com/laravel/laravel/blob/master/.env.example
luego ejecutar
cp .env.example .env
@engelcituk
engelcituk / Convertir un numero en un decima tipo 10.00
Last active February 12, 2021 23:43
Convertir un numero en un decima tipo 10.00
(Math.round( stringToDecimal * 100) / 100).toFixed(2)
Descartar cambios en local
git checkout -- .
@engelcituk
engelcituk / js
Created December 15, 2020 16:57
Acceder a un estado desde otro modulo (ejemplos)
const { cliente } = context.rootState.cart //busco en cart el objeto cliente, donde cart es el modulo
const {idUser, name, lastname } = context.rootState.auth.user //contexto para acceder a los datos del usuario (modulo auth)