Skip to content

Instantly share code, notes, and snippets.

View victorouttes's full-sized avatar

Victor Outtes victorouttes

View GitHub Profile
@victorouttes
victorouttes / intellij_problems.md
Created April 12, 2023 11:31
intelliJ Cannot access java.lang.Object

Para o problema Cannot access java.lang.Object

Faça isso

File -> Invalidate Caches / Restart... -> Invalidate and restart

Caso não funcione faça: make sure in the definition of your SDK, the vm.jar file is included (File > Project Structure > Platform Settings > SDKs)

$PATH_TO_SDK/jre/bin/default/jclSC180/vm.jar
@victorouttes
victorouttes / timeseries.md
Created June 7, 2022 20:39
timeseries functions
def series_to_supervised(data, n_in=1, n_out=1, dropnan=True):
    """
    Frame a time series as a supervised learning dataset.
    Arguments:
        data: Sequence of observations as a list or NumPy array.
        n_in: Number of lag observations as input (X).
        n_out: Number of observations as output (y).
        dropnan: Boolean whether or not to drop rows with NaN values.
    Returns:
@victorouttes
victorouttes / anaconda_pycharm.md
Created April 23, 2022 15:01
windows anaconda pycharm
  1. Go to File -> Settings -> Tools -> Terminal.

  2. Replace the value in Shell path with cmd.exe "/K" C:\path\to\Anaconda3\Scripts\activate.bat your_environment_name.

@victorouttes
victorouttes / django_makemigrations.md
Created January 31, 2022 13:36
Django: makemigrations no changes detected

Quando você organiza seus models em uma pasta models e coloca os modelos como arquivos, o Django não os detecta automaticamente, mesmo colocando no settings.py.

Assim, você precisa ir no arquivo <seu_app>/models/__init__.py e mandar importar as classes 1 a 1, como por exemplo:

from cadastro.models.grupo_resposta import GrupoResposta
from cadastro.models.ponto import Ponto
from cadastro.models.resposta import Resposta
@victorouttes
victorouttes / django_bug_sidebar.md
Last active January 31, 2022 12:40
Django sidebar Bug

Para corrigir o bug da sidebar do admin do django, coloque isto no seu urls.py principal:

from django.contrib import admin

admin.autodiscover()
admin.site.enable_nav_sidebar = False

[...]
@victorouttes
victorouttes / podman.md
Created November 23, 2021 17:55
podman configuration

Configurar podman

sudo apt-get -y install podman
pip3 install podman-compose

Atualizar o PATH: colocar PATH=/home/<seu-usuario>/.local/bin:$PATH.

Testar:

@victorouttes
victorouttes / dremio_clean_data.md
Last active March 3, 2022 13:06
Dremio clean data

Data with mixed types

Convert to text:

CAST(column as VARCHAR(2048)) AS column

Convert to text dealing with NULL values

CAST(column as VARCHAR(2048)) AS column
@victorouttes
victorouttes / selenium_rename_downloaded.py
Created July 9, 2021 12:26
Selenium Python rename download file
def wait_for_download_and_rename(filename: str):
# function to wait for all chrome downloads to finish
def chrome_downloads(drv):
if not "chrome://downloads" in drv.current_url: # if 'chrome downloads' is not current tab
drv.execute_script("window.open('');") # open a new tab
drv.switch_to.window(driver.window_handles[1]) # switch to the new tab
drv.get("chrome://downloads/") # navigate to chrome downloads
return drv.execute_script("""
return document.querySelector('downloads-manager')
.shadowRoot.querySelector('#downloadsList')
@victorouttes
victorouttes / videos-mkv-mp4.md
Created May 17, 2020 23:59
Converter videos mkv para mp4

Instale o pacote ffmpeg e rode, na pasta onde estão os videos *.mkv:

for f in *.mkv; do ffmpeg -i "$f" -c copy -map 0 -c:s mov_text "${f%.mkv}.mp4"; done
@victorouttes
victorouttes / dremio.md
Last active February 7, 2024 18:18
Instalação do Dremio

Instalação básica do Dremio

Rodar este docker-compose.yml no servidor:

version: '3.1'

services:

  dremio:
    image: dremio/dremio-oss:<tag>
 container_name: dremio