Skip to content

Instantly share code, notes, and snippets.

View kazzkiq's full-sized avatar

Claudio Holanda Jr. kazzkiq

View GitHub Profile
INFO [14:40:32.431 #75876] ⬛ Onyx::HTTP::Server is listening at http://127.0.0.1:5000
DEBUG [14:40:35.927 #75876] [sql] SELECT * FROM bookmarks WHERE (bookmarks.id = ?)
DEBUG [14:40:35.929 #75876] 2.42ms
DEBUG [14:40:35.929 #75876] [sql] UPDATE bookmarks SET date_modified = ? WHERE (bookmarks.id = ?)
ERROR [14:40:36.175 #75876] [875ff9eb] ERROR cast from DB::ExecResult to DB::ResultSet+ failed, at /Users/kazzkiq/Works
pace/Favhive/favhive-api/lib/mysql/src/mysql/statement.cr:34:5:34
cast from DB::ExecResult to DB::ResultSet+ failed, at /Users/kazzkiq/Workspace/Favhive/favhive-api/lib/mysql/src/mysql/st
atement.cr:34:5:34 (TypeCastError)
from lib/mysql/src/mysql/statement.cr:0:5 in 'perform_query'
@kazzkiq
kazzkiq / Tutorial.md
Created January 19, 2022 02:12
Download entire website with wget

Simply run this command:

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org

The command will download the website and any link it finds, and update those links to run even if you call them locally.

@kazzkiq
kazzkiq / exemplo-rota-hydration.svelte
Last active April 17, 2022 02:20
Exemplo de rota SvelteKit que chama APIs já no backend e retorna a tela hidratada no front.
<script context="module">
// Ao invés de fazer essas chamadas para APIs dentro dos componentes (Componente1 e Componente2)
// ela já é feita aqui na rota, dentro desse bloco context="module", e retornada como props
// para a própria tela.
// E aí a tela é que passa os dados para os componentes via props.
export async function load ({ params, fetch }) {
const result = await (await fetch("ENDPOINT_DA_API_AQUI")).json();
return {
props: {
required: "The '{field}' field is required.",
string: "The '{field}' field must be a string.",
stringEmpty: "The '{field}' field must not be empty.",
stringMin: "The '{field}' field length must be greater than or equal to {expected} characters long.",
stringMax: "The '{field}' field length must be less than or equal to {expected} characters long.",
stringLength: "The '{field}' field length must be {expected} characters long.",
stringPattern: "The '{field}' field fails to match the required pattern.",
stringContains: "The '{field}' field must contain the '{expected}' text.",
stringEnum: "The '{field}' field does not match any of the allowed values.",