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 August 17, 2026 09:07
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 April 13, 2025 08:06
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 / 0 - Multiple git identities on one machine.md
Last active September 9, 2026 16:19
Multiple git identities on one machine: config per folder and per provider (personal vs work). Every command verified.

Multiple git identities on one machine

One machine, several git identities (personal vs work, GitHub vs GitLab, two accounts on one provider). Each repository picks its own name, email and credentials. In a hurry: Appendix B, once per rule.

A wrong identity does not fail: git commits and pushes under the wrong author. Part 1 ends with the check that catches it.

Requirements

Feature Minimum git
@isaqueprofeta
isaqueprofeta / instala_ccd_serpro_ubuntu.sh
Last active July 24, 2026 21:03
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