Skip to content

Instantly share code, notes, and snippets.

View joaomneto's full-sized avatar

João Neto joaomneto

  • Lisbon
View GitHub Profile
@joaomneto
joaomneto / keybase.md
Created June 28, 2018 15:37
Keybase verification

Keybase proof

I hereby claim:

  • I am joaomneto on github.
  • I am joaoneto (https://keybase.io/joaoneto) on keybase.
  • I have a public key ASA1mA-HoR9NMZhEex5UPxuwTE8pglk_ysQPcs6rLzpj_go

To claim this, I am signing this object:

How git works

Word of warning: you don't need to use the command line, but you need to know the basics. Please first know how to do things in their simplest form and only then move to magic GUIs.

Starting (or my very first two commits)

  1. It all starts with a git init

How git works

Word of warning: you don't need to use the command line, but you need to know the basics. Please first know how to do things in their simplest form and only then move to magic GUIs.

Starting (or my very first two commits)

  1. It all starts with a git init
@joaomneto
joaomneto / parsing.kt
Created December 5, 2022 16:28
advent of code 2022 day 5 cparsing
fun parseFilePart1(inputStream: InputStream) = with(inputStream.bufferedReader()) {
var line: String? = null
val stacksRaw = mutableListOf<String>()
val moves = mutableListOf<List<Int>>()
var movesListBegun = false
while (true) {
line = readLine()
when {
line == null -> break
@joaomneto
joaomneto / trakt_api.kts
Created January 20, 2023 11:22
trakt api pull ratings
import io.ktor.client.HttpClient
import io.ktor.client.request.header
import io.ktor.client.request.post
import io.ktor.http.HttpHeaders
import io.ktor.http.formUrlEncode
suspend fun generateAccessToken(clientId: String, clientSecret: String, username: String, password: String): String {
val client = HttpClient()
val response = client.post<String>("https://api.trakt.tv/oauth/token") {
header(HttpHeaders.Authorization, "Basic ${base64Encode("$clientId:$clientSecret")}")
@joaomneto
joaomneto / mysql_collate_bug
Last active January 5, 2024 00:57
MySQL v8 COLLATE BUG
#!/bin/bash
# MySQL Docker image details
MYSQL_IMAGE="mysql:8.0.30"
MYSQL_ROOT_PASSWORD="your_root_password"
# MySQL database details
MYSQL_DATABASE="test"
MYSQL_USER="root"