Skip to content

Instantly share code, notes, and snippets.

@davidgg
davidgg / settings.json
Created April 10, 2020 11:13
VSCode conf
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"css.validate": false,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 14,
@davidgg
davidgg / RxJS.md
Created November 7, 2019 12:22
RxJS

RxJS Introduction

What

RxJS allows us to manage and manipulate streams of data.

Theory

RxJS is the JS implementation of Reactive X, an API for asynchronous programming with observable streams.

@davidgg
davidgg / micro-frontends.md
Created June 20, 2019 11:26
Micro Frontends

Micro Frontends Architecture

What

Micro frontends are the technical representation of a business subdomain, they provide strong boundaries with clear contracts, also they avoid sharing logic with other subdomains (DDD) Luca Mezzalira

Domain and subdomains are concepts used mainly in backend projects, but they can be used in frontend as well.

Micro Frontends is an old topic, with lots of different approaches. Same paradigm as micro-services in the backend.

@davidgg
davidgg / proxy-server.js
Created March 25, 2019 07:58
Express proxy server
// Avoid CORS issues using a local proxy server
const express = require('express');
const request = require('request');
const cors = require('cors');
const app = express();
const url = 'http://sample.com';
app.use(cors());
@davidgg
davidgg / HuskyHooks.md
Last active December 18, 2019 09:04
Husky Hooks - package.json
@davidgg
davidgg / mysql-helpful-commands.md
Created February 28, 2019 10:16
MySql commands

MySql Helpful Commands

Connect

mysql -u [username] -p;

Show all databases

show databases;
@davidgg
davidgg / .gitconfig
Last active December 28, 2022 12:09
Git
[user]
name = DavidGG
email = yourmail@example.com
[core]
# Don't consider trailing space change as a cause for merge conflicts
whitespace = -trailing-space
[color]
# Enable colors in color-supporting terminals
atom-sync-settings
@davidgg
davidgg / urlParameters.js
Created June 17, 2015 10:25
Get URL Parameters
//From: http://www.jquerybyexample.net/2012/06/get-url-parameters-using-jquery.html
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++) {
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam) {
return sParameterName[1];
}
@davidgg
davidgg / loading.html
Created June 10, 2015 09:56
Simple CSS spin loading
<div class="spin-loading"></div>