Skip to content

Instantly share code, notes, and snippets.

View anartzdev's full-sized avatar
🏠
Working from home

anartzdev

🏠
Working from home
View GitHub Profile
@anartzdev
anartzdev / app.component.ts
Last active June 29, 2022 14:25
Default Layer feature
import { IConfigMap, IMarker, tileLayers } from '@mugan86/ng-leaflet';
import { Component } from '@angular/core';
@Component({
selector: 'app-map',
templateUrl: './map.component.html',
styleUrls: ['./map.component.css']
})
export class MapComponent{
markers: Array<IMarker> = [
{
@anartzdev
anartzdev / projects-graphql.md
Created July 6, 2022 12:03
Interest GraphQL Projects

Interest GraphQL Projects:

@anartzdev
anartzdev / custom-http-loader.ts
Created August 8, 2022 12:31
Multihttploader
import { TranslateLoader } from '@ngx-translate/core';
import { HttpClient } from '@angular/common/http';
import { forkJoin, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import merge from 'deepmerge'; // need install dependencies with npm i deepmerge
export class CustomTranslateLoader implements TranslateLoader {
constructor(private http: HttpClient, private prefix: string = 'app') {}
public getTranslation(lang: string): any {
return this.http.get(
{
"root": true,
"ignorePatterns": ["projects/**/*"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
@anartzdev
anartzdev / article.md
Last active July 16, 2023 17:25
Article information - ESLint + Prettier + Husky + Gitflow in Angular

(Pendiente añadir un ejemplo real con una app Angular e imágenes de capturas dentro del editor) El objetivo principal de este artículo es proporcionar los pasos a seguir con las instrucciones detalladas y necesarias para poder configurar un proyecto de Angular con las herramientas que nos va a ayudar a trabajar con buenas prácticas.

Estas buenas prácticas que queremos aplicar se realizarán tanto en la escritura del código, siguiendo una línea estable de escritura con unas normas preestablecidas y también en lo que respecta a la adición de mensajes de commit donde realizaremos las configuraciones necesarias con el objetivo de respetar la convención para escribir los mensajes de commit siguiendo una estructura común que se usará en infinidad de proyectos, con lo que esto proporcionará una forma de trabajar estable y correcta mediante git flow escribiendo mensajes de commit.

@anartzdev
anartzdev / form-config.js
Created September 1, 2022 13:31
Configuración formulario
{
"controls": [
{
"name": "firstName",
"label": "First name:",
"value": "",
"type": "text",
"validators": {
"required": true,
"minLength": 10
@anartzdev
anartzdev / helpers\array.ts
Last active September 28, 2022 13:13
Back To Home option
import { ControlPosition } from "leaflet";
...
export interface IBackToHomeOptions {
position?: ControlPosition;
home?: {lat: number, lng: number};
text?: string;
}
@anartzdev
anartzdev / index.ts
Created October 27, 2022 06:29
EarthQuakes
import axios from "axios";
import { geoJSON, Map, circleMarker, circle } from "leaflet";
import { tileLayers, tileLayerSelect } from "../../config/tile-layer";
// Para personalizar las zonas con diferentes colores
function getColor(numberValue: number) {
return numberValue >= 0 && numberValue < 1
? "white"
: numberValue >= 1 && numberValue < 2
? "green"
@anartzdev
anartzdev / dynamic-access-object.js
Created November 7, 2022 06:21
Dynamic Access Object - Javascript
const myPersonalData = {
name: 'Anartz',
lastname: 'Mugika Ledo',
birthday: '10-01-1986',
hobbies: [
'hobbies: sports, photography, studying health and technology topics',
],
blog: 'https://mugan86.medium.com/',
portfolio: 'https://anartz-mugika.com/',
};
@anartzdev
anartzdev / index.html
Created November 8, 2022 08:02
Chrome Extension Short URL
<!DOCTYPE html>
<html>
<head>
<title>Fast URL Shortener</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="box">
<h2>Fast URL Shortener</h2>