Skip to content

Instantly share code, notes, and snippets.

View viniciusgati's full-sized avatar

Vinicius Gati viniciusgati

View GitHub Profile
@viniciusgati
viniciusgati / algoritmo-simples-1.txt
Last active May 22, 2026 14:23
Teste de lógica 1
Faça um programa para ajudar uma pessoa a medir a quantidade de bolos que ela pode fazer com a quantidade de ingredientes que ela possui!
Você deve obter a quantidade de farinha disponível em gramas, a quantidade de leite disponível em ml's e a quantidade de ovos disponíveis.
Tendo como base que 1 bolo precisa de 2 ovos, 500gr de farinha e 500ml de leite.
Informe o usuário quantos bolos podem ser feitos com a quantidade de ingredientes disponíveis.
Exemplo de resultado:
Com 4 ovos, 500gr de farinha e 1000ml de leite o resultado da quantidade de bolos que posso fazer deve ser de 1 bolo.
@alexishida
alexishida / rails-oracle-client-18-linux.txt
Last active February 27, 2023 00:19
Rails Oracle Client 18 Linux
# Instalar a biblioteca
sudo apt-get install libaio1
# Criar a pasta
sudo mkdir /opt/oracle
# Extrair para /opt/oracle
instantclient-basic-linux.x64-18.5.0.0.0dbru.zip
instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip
@caridy
caridy / export-syntax.js
Last active January 15, 2022 14:22
ES6 Module Syntax Table
// default exports
export default 42;
export default {};
export default [];
export default foo;
export default function () {}
export default class {}
export default function foo () {}
export default class foo {}
@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@taq
taq / gist:5699377
Created June 3, 2013 16:28
Stupid PHP static variables behaviour
<?php
class A {
public static $name = null;
}
A::$name = "a";
class B extends A {
}
B::$name = "b";