Skip to content

Instantly share code, notes, and snippets.

View dannluciano's full-sized avatar
🏠
Working from home

Dann Luciano dannluciano

🏠
Working from home
View GitHub Profile
@dannluciano
dannluciano / columns.sql
Created December 7, 2021 19:48
PostgreSQL util queries
-- Adapted from information_schema.columns
SELECT
c.oid :: int8 AS table_id,
nc.nspname AS schema,
c.relname AS table,
(c.oid || '.' || a.attnum) AS id,
a.attnum AS ordinal_position,
a.attname AS name,
CASE
@dannluciano
dannluciano / Cesar.java
Created December 7, 2021 19:44
Cifra de Cesar
import java.util.Scanner;
public class Cesar {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
char[] mapa = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int chave = 26;
while (chave < 0 || chave > 25) {
@dannluciano
dannluciano / CifraROT13.java
Created December 7, 2021 19:43
CifraROT13
import java.util.Scanner;
public class CifraROT13 {
public static void main(String[] args) {
char[] mapa = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int chave = 13;
Scanner teclado = new Scanner(System.in);
System.out.println("ROT13");
import java.util.Scanner;
public class Rot13 {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
char[] mapa = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int chave = 13;
System.out.println("ROT13");
while(true){
@dannluciano
dannluciano / index.js
Last active August 30, 2021 12:20
Deno Deploy Log Test
addEventListener("fetch", (event) => {
console.log("Req", event.request)
event.respondWith(
new Response("Hello world", {
status: 200,
headers: {
server: "deploy",
"content-type": "text/plain",
},
}),
@dannluciano
dannluciano / ffmpeg.md
Created June 23, 2021 14:12 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet
@dannluciano
dannluciano / loader.py
Created June 12, 2021 19:53
Loader in Python
import sys
import time
cols = 59
steps = 100
if len(sys.argv) > 2:
steps = int(sys.argv[1])
for s in range(steps):
@dannluciano
dannluciano / using-uuid-as-pk.md
Created December 31, 2020 02:35 — forked from rponte/using-uuid-as-pk.md
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

@dannluciano
dannluciano / Main.java
Created December 18, 2020 18:44
Jogo da Velha
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
char c1 = '1', c2 = '2', c3 = '3',
c4 = '4', c5 = '5', c6 = '6',
c7 = '7', c8 = '8', c9 = '9';
char jogadorAtual = 'X';
@dannluciano
dannluciano / python-guide.sh
Created February 11, 2020 14:27 — forked from fernandolcouto/python-guide.sh
The definitive guide to setup my Python workspace
# The definitive guide to setup my Python workspace
# Author: Henrique Bastos <[email protected]>
PY3=3.8.0
#PY2=2.7.16
PY3TOOLS="youtube-dl pandas s3cmd fabric pytest"
#PY2TOOLS="rename mercurial"
VENVS=~/.ve
PROJS=~/workspace