Skip to content

Instantly share code, notes, and snippets.

View dianjuar's full-sized avatar

Diego Julião dianjuar

View GitHub Profile
@dianjuar
dianjuar / check-postgres-extension-and-schema.md
Created September 17, 2021 16:35
Check which extension belongs to which schema

Verify what Postgres extension belongs to what schema

SELECT
    e.extname AS "Name",
    e.extversion AS "Version",
    n.nspname AS "Schema",
    c.description AS "Description" 
FROM pg_catalog.pg_extension e 
LEFT JOIN pg_catalog.pg_namespace n 
@dianjuar
dianjuar / transform-array-to-dictionary.spec.ts
Created December 3, 2020 14:45
Transform Array to Dictionary given a property of the object that is being managed on the array. Useful do operations over the array on cost O(n)
describe('transformArrayToDictionary', () => {
type myType = { id: string; data1: boolean; data2: boolean };
let array: myType[];
let expectedDic: { [key: string]: myType };
beforeEach(() => {
array = [
{
id: '1',
data1: true,
@dianjuar
dianjuar / develop-master-differences.md
Created September 14, 2020 21:03
See the commit differences between develop and master

To see the commit differences between develop and master

git checkout master && git pull && git checkout develop && git pull && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..develop

Useful to know what is going to be deployed

@dianjuar
dianjuar / closure-exercicse.md
Last active January 4, 2022 15:00
JS Interview Questions Snipets

What would be the output of these?

1

function() {
  this.foo = 'bar';
  const dummyFn = () => this.foo;

  console.log(dummyFn());
}
@dianjuar
dianjuar / my-extensions-angular-env.md
Created December 3, 2019 15:55
The Vs Code Extensions that I use in an Angular Environment
Name Link Description
Angular 8 Snippets - TypeScript, Html, Angular Material, ngRx, RxJS & Flex Layout [![L
@dianjuar
dianjuar / dockerized-mongo.md
Last active September 10, 2019 20:40
Dockerized Mongo DB environment

Dockerized MongoDB environemnt

A quick an simple dockerized Mongo DB setup

Set up

  1. Create this docker-file in your project.
# Use root/example as user/password credentials
@dianjuar
dianjuar / i3-shortcuts-screenshot.md
Last active May 7, 2025 09:50
My i3 shortcuts to take screenshots

Requirements

  • maim
  • xclip

Set-up

Set this on your i3 config file ~/.i3/config

# Screenshots
@dianjuar
dianjuar / log.js
Last active June 10, 2019 23:07
Simple log function for nodejs
const logPrefix = ' --- ';
const colors = {
reset: '\x1b[0m',
bright: '\x1b[1m',
dim: '\x1b[2m',
underscore: '\x1b[4m',
blink: '\x1b[5m',
reverse: '\x1b[7m',
hidden: '\x1b[8m',

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@dianjuar
dianjuar / catch-web-states.md
Last active April 18, 2019 17:26
A snippet to know how to catch states of your pages. Hovers, toasters, anything very hard to inspect

Open your web console and execute the snippet and wait to be executed then inspect the element

var timeToBeExecuted = 1000;
setTimeout(() => {
	debugger;
}, timeToBeExecuted);