Skip to content

Instantly share code, notes, and snippets.

@mvidaldp
mvidaldp / JupyterLab_HowTo_Extensions.md
Created August 16, 2019 11:31
How to work with JupyterLab extensions (install/enable) userwise: working path and user config setting

You may have noticed that you cannot install JupyterLab extensions on a user level (no root) out of the box on Linux/Unix systems.

After reading and trying different suggestions I recommend the next steps:

1. Build your JupyterLab assets. Open your terminal and run:

JUPYTERLAB_DIR=.jupyter/lab jupyter-lab build

Set the path you want/need, notice that you can run 'jupyter lab' instead of 'jupyter-lab.

@mvidaldp
mvidaldp / DropDownMenuOnScript.cs
Created December 11, 2019 12:47
Add a dropdown menu option on the unity inspector from a script
using UnityEngine;
public class DropDownMenuOnScript : MonoBehaviour
{
public enum Option { one, two, three, four, five }; // declare your dropdown list enumerator class with the options you want
public Option option = Option.one; // instantiate your enumerator (it works both with and without initialization)
...
// your methods
...
}
@mvidaldp
mvidaldp / settings.ini
Last active June 7, 2020 12:30
gtk-3.0 settings file (~/.config/gtk-3.0/settings.ini)
[Settings]
gtk-cursor-theme-name = McMojave Cursors
gtk-font-name = SF Pro Display 10
gtk-icon-theme-name = Papirus
gtk-theme-name = Arc
@mvidaldp
mvidaldp / .gtkrc-2.0
Last active June 7, 2020 12:28
GTK2 settings file (~/.gtkrc-2.0)
gtk-cursor-theme-name = "McMojave Cursors"
gtk-font-name = "SF Pro Display 10"
gtk-icon-theme-name = "Papirus"
gtk-theme-name = "Arc"
@mvidaldp
mvidaldp / gtk2-3_systemwise.md
Created December 14, 2019 16:25
GTK2 and GTK3 settings systemwise

Assuming your GTK2 (/etc/gtk-2.0/gtkrc) and GTK3 (/etc/gtk-3.0/settings.ini) settings files are correctly set as you want. Create the next symlinks and change the ownership:

For GTK2

sudo ln -s /etc/gtk-2.0/gtkrc /usr/share/gtk-2.0/gtkrc
sudo ln -s /etc/gtk-2.0/gtkrc /usr/share/gtk-2.0/gtkrc ~/.gtkrc-2.0
sudo chown username:username .gtkrc-2.0
@mvidaldp
mvidaldp / customize_windows_promt.md
Last active January 28, 2020 15:45
Customize your PowerShell's promt "PS1" Oh My Zsh style and show system information

Assuming that you have Git for Windows installed, otherwise install it first via official website, chocolatey, scoop, etc.

1. Install these modules:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

Assuming that you have a PowerShell profile (check by Test-path $profile), otherwise create one by New-item –type file –force $profile.

@mvidaldp
mvidaldp / how_to_hide_clink_message.md
Last active December 15, 2019 00:31
Hide Clink author message on opening prompt
@mvidaldp
mvidaldp / profiles.json
Last active January 24, 2020 13:54
Windows Terminal settings example (with Gentoo and Debian WSL, PowerShell, PowerShell Core, CMD and Azure Cloud Shell)
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"globals" :
{
"alwaysShowTabs" : true,
"copyOnSelect": true,
"defaultProfile" : "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"initialCols" : 110,
"initialRows" : 25,
"keybindings" :
@mvidaldp
mvidaldp / choco_globalconfirmation.md
Created January 24, 2020 23:36
Skip install/uninstall/update confirmation while using Chocolatey package manager (avoid -y parameter)
choco feature enable -n allowGlobalConfirmation
@mvidaldp
mvidaldp / parallelize.py
Created January 27, 2020 17:57
Dummy example of process parallelization in Python
from multiprocessing import Pool, cpu_count
cores = cpu_count()
# whatever parameters or stuff you want to iterate over to run them on your job (function call)
parameters = [0, 1, 2, 3]
def job(iter):
# the code you want to parallelize