Skip to content

Instantly share code, notes, and snippets.

View joellobo's full-sized avatar

Joel Lobo joellobo

View GitHub Profile
String divTemplate =
"""
<div class=\"card text-white bg-dark mb-3\" style=\"max-width: 18rem;\">
<h4 class=\"card-header\">%s</h4>
<div class=\"card-body\">
<img class=\"card-img\" src=\"%s\" alt=\"%s\">
<p class=\"card-text mt-2\">Nota: %s - Ano: %s</p>
</div>
</div>
""";
@rponte
rponte / using-uuid-as-pk.md
Last active June 29, 2024 15:42
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

const IS_TEST = process.env.NODE_ENV === 'test';
const ONE_SECOND_TIMEOUT = 1000;
class Util {
static async delayedCall(fn, params, time = ONE_SECOND_TIMEOUT) {
return new Promise((resolve, reject) => setTimeout(() => {
fn(...params)
.then(resolve)
.catch(reject);
}, time));
@taylor-jones
taylor-jones / vs_curl.py
Created September 22, 2019 19:47
Download the latest versions of all installed VS Code extensions w/ cURL
"""
Download the latest versions of all installed VSCode extensions with cURL.
TODO: Add option to automatically install all the downloaded extensions.
TODO: Add option to provide any list of extensions, not just the installed ones.
TODO: Update to allow for specifying extension version (but default to latest version).
TODO: Update to check for directory existence (and make one if it doesn't exist).
"""
import os
@jjuanrivvera99
jjuanrivvera99 / mssql-docker-compose.yml
Last active June 20, 2024 17:32
SQL Server with Docker Compose
version: '3.3'
services:
mssql:
container_name: sql-server
image: mcr.microsoft.com/mssql/server:2017-latest
#image: mcr.microsoft.com/mssql/server:2017-CU11-ubuntu
restart: always
environment:
ACCEPT_EULA: "Y"
@mouselangelo
mouselangelo / avd-hardware-profile-huawei-mate-20x.xml
Created July 23, 2019 10:51
Android: Basic AVD Hardware profile for the Huawei Mate 20 X phone
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<d:devices xmlns:d="http://schemas.android.com/sdk/devices/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<d:device>
<d:name>HUAWEI Mate 20 X</d:name>
<d:manufacturer>HUAWEI</d:manufacturer>
<d:meta/>
<d:hardware>
<d:screen>
<d:screen-size>large</d:screen-size>
<d:diagonal-length>7.20</d:diagonal-length>
@rahulbagal
rahulbagal / dart.password.check
Created April 26, 2019 11:53
Dart : How to check if password contains all required characters
# Dart: Validate Password
This code snippet shows how to validate a password
**Requirement** :
Password should be more than 8 characters long
It should contain
at least one Uppercase ( Capital ) letter
at least one lowercase character
at least digit and
special character.
@bgauduch
bgauduch / multiple-repository-and-identities-git-configuration.md
Last active June 25, 2024 13:22
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@isaqueprofeta
isaqueprofeta / instala_ccd_serpro_ubuntu.sh
Last active March 12, 2024 12:56
Passos para instalação de certificados do SERPRO no Ubuntu
# Entrar na pasta de certificados do sistema:
# Ubuntu anterior ao 18:
sudo mkdir /usr/share/ca-certificates/serpro/
sudo cd /usr/share/ca-certificates/serpro/
# Ubuntu 18:
sudo mkdir /usr/local/share/ca-certificates/serpro/
cd /usr/local/share/ca-certificates/serpro/
# Baixar os certificados do repositorio:
wget -r --no-check-certificate https://ccd.serpro.gov.br/serproacf/docs/
@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y