Skip to content

Instantly share code, notes, and snippets.

View mvidaldp's full-sized avatar
🎯
Focusing

Marc Vidal De Palol mvidaldp

🎯
Focusing
  • Cologne, Germany
View GitHub Profile
@mvidaldp
mvidaldp / HowTo_Pull_APK_from_installed_app_from_Android.md
Created May 13, 2020 16:53
Get APK from installed app from Android device

Assuming you have adb installed in your OS, your Android phone is connected to it via USB, debugging is enabled, and you can see your phone running adb devices. Open your terminal and run:

adb shell pm list packages |grep AppName

This will show you something like package:/path/to/your/app.apk Without |grep AppName or the search filter you use it will list all installed Apps.

Finally, just run:

@mvidaldp
mvidaldp / HowTo_ipynb_to_RevealJS_slides.md
Created April 16, 2020 15:35
How to convert Jupyter Notebook into Reveal.js slides excluding code
  1. Assuming your slides are already defined on your notebook, add the tag to_remove to all cells you don't want the code to be shown on your presentation.
  2. Then run this on your terminal:
jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"} --post serve --SlidesExporter.reveal_theme=simple
@mvidaldp
mvidaldp / HowTo_RevealJS_to_PDF.md
Last active April 16, 2020 15:16
How to convert Reveal.js slides to PDF
  1. Rename your Reveal.js slides URL ending by adding ?print-pdf. Example:
https://127.0.0.1/presentation.slides.html?print-pdf
  1. By reloading the slides with this URL ending, all slides are shown after each other and are ready to be printed.
  2. Then, in your web browser menu, go to Print..., then select Print to File and finally click the Print button.
@mvidaldp
mvidaldp / launcher.desktop
Created March 18, 2020 12:33
How to make Linux launchers (.desktop) use environment variables (normally on .bashrc)
[Desktop Entry]
# Note that this is not a complete launcher entry
# make sure you modify the Exec parameter of your launcher like this example
Exec=sh -c "YOURVAR=yourpathorvalue /usr/bin/yourApp"
@mvidaldp
mvidaldp / ignore_large_files_on_github.sh
Created March 9, 2020 13:53
Automatically find and ignore large files on GitHub
#!/bin/bash
# change data/ for your folder name or . for current
# change +50M for the file size you want to ignore
find data/ -size +50M | cat >> .gitignore
@mvidaldp
mvidaldp / how_to_add_venv_on_jupyter_notebook_lab.md
Last active March 27, 2020 12:40
Add venv (virtual environment) Python kernel to Jupyter Lab or Jupyter Notebook

Assuming you are on your virtual environment:

pip install ipykernel
python -m ipykernel install --user --name venvname --display-name "Python (venvname)"
# run `jupyter kernelspec uninstall venvname` to remove it afterwards
@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
@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 / 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 / how_to_hide_clink_message.md
Last active December 15, 2019 00:31
Hide Clink author message on opening prompt