Skip to content

Instantly share code, notes, and snippets.

View caiofcm's full-sized avatar
🎯
Focusing

Caio Curitiba Marcellos caiofcm

🎯
Focusing
View GitHub Profile
@caiofcm
caiofcm / vscode_right_click.nemo_action
Created July 17, 2018 17:23
Some Linux related code
# Create Visual Studio Code right click shortcut to open a folder in Nemo
[Nemo Action]
Name=Open in VS Code
Comment=Open Folder in VS Code
Quote=double
Exec=code %P
Selection = any
Extensions=dir;
@caiofcm
caiofcm / gen_report_pweave.py
Last active August 1, 2018 15:36
Utility to run Pweave passing options for output file name
"""
Utility to run Pweave passing options:
`python gen_report_pweave.py --help`
usage: gen_report_pweave.py [-h] [-d OUTPUTDIR] [-t] [-r] [-o] source prefix
Run pypublish to generate a pdf
positional arguments:
source python filename
@caiofcm
caiofcm / jupyter_notebook_config.py
Last active August 15, 2018 13:04
Jupyter Auxiliaries files
# Reference: https://svds.com/jupyter-notebook-best-practices-for-data-science/
import os
from subprocess import check_call
def post_save(model, os_path, contents_manager):
"""post-save hook for converting notebooks to .py scripts"""
if model['type'] != 'notebook':
return # only do this for notebooks
d, fname = os.path.split(os_path)
@caiofcm
caiofcm / install_sundials.md
Last active October 23, 2018 10:17
install sundials ubuntu
@caiofcm
caiofcm / install-wkhtmltopdf.sh
Created March 1, 2019 14:13
Install wkhtmltopdf on ubuntu
#!/usr/bin/env sh
sudo apt-get install -y openssl build-essential xorg libssl-dev xfonts-75dpi
wget "https://downloads.wkhtmltopdf.org/0.12/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb"
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
@caiofcm
caiofcm / hide_code.tpl
Created March 1, 2019 14:15
Template for Latex export hiding all input cells, run with: jupyter nbconvert --template hide_code.tpl --to pdf --output filename
{%- extends 'full.tpl' -%}
{% block input_group -%}
<div class="input_hidden">
{{ super() }}
</div>
{% endblock input_group %}
{%- block header -%}
{{ super() }}
@caiofcm
caiofcm / rcloneCommandsForSaferCopy.md
Created August 30, 2019 01:53
Commands used with rclone for copying files

rclone copy remote-rclone-name:remote-folder ./local-folder -v -P -u --dry-run

-u: no overwriting -P progress -v verbose --dry-run: ...

@caiofcm
caiofcm / python.json
Created August 30, 2019 16:10
VSCode snippets - Comment, import
{
/*
// Place your snippets for Python here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@caiofcm
caiofcm / supervisely2coco.py
Last active March 19, 2026 02:58
Converting Supervisely output to COCO format (only detection in this version)
##
# Author: Caio Marcellos
# Email: caiocuritiba@gmail.com
##
import os
import numpy as np
import json
import glob
from datetime import datetime
from pathlib import Path
@caiofcm
caiofcm / fbphrophet_dockerfile.md
Created October 12, 2020 23:40
Running Facebook Phrophet in a Docker container

Running Facebook Phrophet in a Docker container

Setup

The Dockerfile in a working folder:

FROM python:3.7
# based on: https://gist.github.com/stefanproell/89a00f3a2c18a7e9549a1de6f82cf0f8