Skip to content

Instantly share code, notes, and snippets.

View jon-dearaujo's full-sized avatar
😮‍💨

Jonathan Henrique de Araújo Silva jon-dearaujo

😮‍💨
  • IPSY | BFA Industries
  • Recife, Pernambuco. Brazil.
  • X @jon_dearaujo
View GitHub Profile
@jon-dearaujo
jon-dearaujo / install_docker_ce_debian.sh
Last active January 23, 2025 10:57
Install Docker CE on Debian Bookworm 12
#!/usr/bin/zsh
# Delete old versions
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done;
# Add Docker's official GPG key:
sudo apt-get update;
sudo apt-get install ca-certificates curl;
sudo install -m 0755 -d /etc/apt/keyrings;
# vim:fileencoding=utf-8:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family Monaspace Argon Var,Cascadia Code PL
# bold_font auto
@jon-dearaujo
jon-dearaujo / flip_matrix.py
Last active August 22, 2019 13:45
Flip a numeric matrix with Python 3.
def _flip_matrix(matrix, n_90_degrees_flips):
'''
Let's say that we have the following matrix:
1 , 2 , 3 , 4
5 , 6 , 7 , 8 => [[1 , 2 , 3 , 4], [5 , 6 , 7 , 8], [9 , 10, 11, 12], [13, 14, 15, 16]]
9 , 10, 11, 12
13, 14, 15, 16
And we want to flip it 1x in a way that it looks like the following
13, 9 , 5, 1
14, 10, 6, 2
@jon-dearaujo
jon-dearaujo / BSTOPS.py
Created July 9, 2019 13:19
Binary Search Tree operations with Python
class Node:
def __init__(self, key=None, left=None, right=None, parent=None, value=1):
self.key = key
self.left = left
self.right = right
self.parent = parent
self.value = value
def insert(key, value, node, parent=None):
if not node:
@jon-dearaujo
jon-dearaujo / github-repos-search.svelte
Created May 9, 2019 00:57
Github repos search Svelte app
<script>
const GITHUB_REPOS_SEARCH_URL = 'https://api.github.com/search/repositories?q='
const debounce = (milliseconds) => {
return new Promise((resolve, reject)=> {
if (debounceId) {
clearTimeout(debounceId)
}
debounceId = setTimeout(()=> {
debounceId = null
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
const gapi = window['gapi'];