Skip to content

Instantly share code, notes, and snippets.

View ricardopadua's full-sized avatar
🎯
Focusing

Ricardo Pádua ricardopadua

🎯
Focusing
View GitHub Profile
@ricardopadua
ricardopadua / detect.livemd
Created November 2, 2024 02:23 — forked from ChristianAlexander/detect.livemd
Face Detection in Elixir

Face Detection in Elixir

Mix.install(
  [
    {:evision, "~> 0.1"},
    {:kino, "~> 0.7"}
  ],

Podcast Transcription

Mix.install([
  {:req, "~> 0.4.14"},
  {:fast_rss, "~> 0.5.0"},
  {:bumblebee, "~> 0.5.3"},
  {:exla, "~> 0.7.1"},
  {:kino, "~> 0.12.3"}
])
@ricardopadua
ricardopadua / GitCommitEmoji.md
Created September 11, 2024 21:21 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@ricardopadua
ricardopadua / .aws-creds
Created August 16, 2024 19:12 — forked from shawngmc/.aws-creds
Caddy Example Files
[default]
aws_access_key_id=XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
aws_region=us-east-1
@ricardopadua
ricardopadua / observer.md
Last active September 27, 2023 15:24
Debugging Elixir

Debugging - In this lesson we'll learn about debugging Elixir code as well as static analysis tools to help find potential bugs

IEx

The most straightforward tool we have for debugging Elixir code is IEx.

But don't be fooled by its simplicity - you can solve most of the issues with your application by it.

IEx means Elixir's interactive shell.

@ricardopadua
ricardopadua / github_desktop_ubuntu.sh
Created August 28, 2023 16:32 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2022-11-07): Thanks to Sxvxgee's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/GitHubDesktop-linux-3.1.1-linux1.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-3.1.1-linux1.deb
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
@ricardopadua
ricardopadua / wxWidgetInstall.md
Created June 7, 2023 22:43 — forked from pemd-sys/wxWidgetInstall.md
Installing wxWidgets

Installing wxWidgets on Ubuntu

The latest download and install instructions are available in
https://docs.wxwidgets.org/3.1/plat_gtk_install.html
The wiki is a bit old so try following the above and consult the wiki for more details. BUT, follow the steps as per the docs NOT the wiki.
https://wiki.wxwidgets.org/Compiling_and_getting_started

However sometimes specially for new linux users it can become overwhelming and installation process can throw funny errors. So I have created a step by step process to hopefully help you compile wxwidgets. Enjoy :-)

Installing pre-requisites

@ricardopadua
ricardopadua / tmux.conf
Created May 30, 2023 22:31 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@ricardopadua
ricardopadua / stream_csv.ex
Last active May 4, 2023 11:20 — forked from tngan/stream_csv.ex
Streaming CSV straight out of the database to the client using Elixir, Phoenix, Ecto and PostgreSQL.
def index(conn, _params) do
conn = conn
|> put_resp_content_type("text/csv")
|> put_resp_header("content-disposition", "attachment; filename=export.csv")
|> send_chunked(200)
Repo.transaction fn ->
Ecto.Adapters.SQL.stream(Repo, "COPY expensive_report TO STDOUT CSV HEADER")
|> Stream.map(&(chunk(conn, &1.rows)))
|> Stream.run
@ricardopadua
ricardopadua / config
Last active August 26, 2022 15:55
sample configuration pgadmin4
AUTHENTICATION_SOURCES = ['oauth2']
OAUTH2_AUTO_CREATE_USER = True
OAUTH2_CONFIG = [{
'OAUTH2_NAME': 'github',
'OAUTH2_DISPLAY_NAME': 'Github',
'OAUTH2_CLIENT_ID': xxxxxxxxxx,
'OAUTH2_CLIENT_SECRET': xxxxxxxxxxxx,
'OAUTH2_TOKEN_URL': 'https://github.com/login/oauth/access_token',
'OAUTH2_AUTHORIZATION_URL': 'https://github.com/login/oauth/authorize',
'OAUTH2_API_BASE_URL': 'https://api.github.com/',