Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mugan86's full-sized avatar
💻
💪💪

Anartz Mugika Ledo mugan86

💻
💪💪
View GitHub Profile
{
countUsers
users (page: 1) {
status
message
list {
id
name
lastname
}
@mugan86
mugan86 / dolmen_route_start.geojson
Created May 25, 2022 20:29
Dolmen Route Start
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mugan86
mugan86 / 00-examples
Last active May 21, 2022 18:07
Angular Leaflet Map - Examples
1.- Basic:
https://stackblitz.com/edit/angular-leaflet-map-basic?file=src%2Fapp%2Fapp.component.ts
2.- Basic + Custom Size
https://stackblitz.com/edit/angular-leaflet-map-basic-custom-size?file=src%2Fapp%2Fapp.component.html
3.- Set Map Center:
https://stackblitz.com/edit/angular-leaflet-map-basic-set-center-position?file=src%2Fapp%2Fapp.component.ts
4.- Zoom Controls - Positions / In out titles
https://stackblitz.com/edit/angular-leaflet-zoom-positions-titles?file=src%2Fapp%2Fapp.component.ts
5.- Zoom Level
https://stackblitz.com/edit/angular-leaflet-zoom-levels?file=src%2Fapp%2Fapp.component.ts
@fmontes
fmontes / server.js
Created April 1, 2022 21:49
Server to return a screenhot of the page you pass in the URL like: http://localhost:3000/?url=https://demo.dotcms.com
const puppeteer = require('puppeteer');
const http = require('http');
const url = require('url');
const requestListener = async function (req, res) {
try {
const { href } = new URL(url.parse(req.url, true).query.url);
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({ width: 1024, height: 768 });
@mugan86
mugan86 / gist:4f51f50a52a60a292e3ce31cd38b4dea
Created September 7, 2021 18:25
Dependencias proyecto Book Store API GraphQL
PRODUCTION
===================
npm install express@^4 apollo-server-express@^3 graphql ncp graphql-import-node compression cors
typescript@^4 graphql-tools@^8
DEV
===================
npm install @types/compression @types/express @types/cors @types/node @types/graphql nodemon ts-node -D
@mugan86
mugan86 / 01-random.js
Last active July 26, 2021 18:40
Javascript tips - Parte 2
// nº aleatorioentre 0 (incluido) y 1 (no incluido)
Math.random(); // 0, 0.02, 0.334,...
// nº aleatorio ENTERO entre 0 (incluido) y el máximo (10, no incluido)
Math.floor(Math.random() * 10); // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
// nº aleatorio ENTERO entre 0 (incluido) y el máximo (11, no incluido)
Math.floor(Math.random() * 11); // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
// aleatorio ENTERO entre 0 (incluido) y el máx. (100, incluido por el +1)
@mugan86
mugan86 / index.ts
Created June 7, 2021 18:29
Extractor de series y películas de API The MovieDB
import axios from "axios";
import express from "express";
const URL = 'http://localhost:4008/graphql';
export const TV = (page: number = 1, primaryYear = -1) => `
{
discoverTv (page: ${page}, primaryYear: ${primaryYear}) {
tvShows {
id
name
var https = require('https');
var xml2js = require('xml2js');
var parser = new xml2js.Parser();
const fs = require('fs');
parser.on('error', function(err) { console.log('Parser error', err); });
var data = '';
https.get('https://www.trafikoa.eus/servicios/IncidenciasTDT/IncidenciasTrafikoTDTGeo', function(res) {
if (res.statusCode >= 200 && res.statusCode < 400) {
res.on('data', function(data_) { data += data_.toString(); });
@mugan86
mugan86 / colors.py
Created May 22, 2021 09:51
Ahorcado - Strangle classes to create game in Python
COLORS = {
'HEADER' : '\033[95m',
'OKBLUE' : '\033[94m',
'OKCYAN' : '\033[96m',
'OKGREEN' : '\033[92m',
'WARNING' : '\033[93m',
'FAIL' : '\033[91m',
'ENDC' : '\033[0m', # Para limpiar el color y resetear
'BOLD' : '\033[1m',
@mugan86
mugan86 / README.md
Created May 12, 2021 19:53
Overriding Schematics in Angular project - angular.json

En este video os voy a explicar como reescribir algunas configuraciones que tenemos por defecto cuando trabajamos con un proyecto de angular. Para ello lo vamos a modificar todo dentro del angular.json añadiendo las opciones que más interesantes nos resulten.

Creamos el proyecto con las siguientes configuraciones

Añadimos un proyecto sencillo de Angular, donde establecemos sin rutas y con estilos por defecto "CSS" ng new schematics-overriding-configs --routing --style=css

Configurar las diferentes opciones para establecer bajo nuestras preferencias

https://angular.io/cli/generate