Skip to content

Instantly share code, notes, and snippets.

View srvanrell's full-sized avatar

Sebastián Vanrell srvanrell

  • Santa Fe, Argentina
View GitHub Profile
@srvanrell
srvanrell / progressbar_tqdm_minimal_example.py
Created June 26, 2020 17:32
A simple example using tqdm for progress bar in a for loop
import time
from tqdm import tqdm
def do_something(x):
time.sleep(0.03)
my_list = [i for i in range(200)]
N = len(my_list)
@srvanrell
srvanrell / zen_python.md
Last active June 8, 2020 21:45 — forked from pyjavo/zen_python.md
El zen de Python: Explicado y con ejemplos

El Zen de Python

Si alguna vez abren la consola de python y escriben import this verán que les aparecerán las líneas con el famoso Zen de Python:

  1. Beautiful is better than ugly.
  2. Explicit is better than implicit.
  3. Simple is better than complex.
  4. Complex is better than complicated.
  5. Flat is better than nested.
  6. Sparse is better than dense.
@srvanrell
srvanrell / README.txt
Created January 31, 2019 15:06
How to use keyboard shortcuts on Spotify Ubuntu 16.04
Configure keyboard shortcuts for Spotify on Ubuntu 16.04
========================================================
Original source: https://askubuntu.com/questions/1105363/spotify-keyboard-controls-not-working
1 - Copy the file spotify_control in your preferred folder (I will use .scripts/ in my home)
2 - The file must have execution permission (chmod a+x spotify_control)
3 - Go to settings -> keyboard -> keyboard shortcuts -> custom shortcuts
4 - Add new shortcut by clicking the plus button. Feel free to choose among the following shortcuts:
.scripts/spotify_control playpause
.scripts/spotify_control previous
@srvanrell
srvanrell / xkcdsinc.py
Last active September 20, 2017 20:18
plot sinc(x) as xkcd
import numpy as np
import matplotlib.pyplot as plt
with plt.xkcd():
fig = plt.figure()
x = np.linspace(-4, 4, 100)
plt.plot(x, np.sinc(x), 'k')
plt.ylabel("sinc(x)")
plt.xlabel("x")
plt.title("How to plot sinc(x) as Randall")
@srvanrell
srvanrell / gist:4a66df984d6b7beb00b4f194fed25f71
Last active January 31, 2019 15:08 — forked from concHNO3/gist:2923266
Set Helvetica Font in Text and Math in LaTeX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set Helvetica Font in Text and Math in LaTeX %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\familydefault}{\sfdefault}
\usepackage[scaled=1]{helvet}
\usepackage[helvet]{sfmath}
\everymath={\sf}
java -Dhttp.proxyHost=ip -Dhttp.proxyPort=port -jar weka-3-9-0/weka.jar
@srvanrell
srvanrell / AddTreeAliasGit.sh
Last active December 29, 2023 15:44
Nice tree view for terminal
git config --global alias.tree 'log --graph --decorate --oneline --abbrev-commit'
#!/bin/bash
drive push --exclude-ops "delete" --ignore-name-clashes --no-prompt ~/gdrive
#!/bin/bash
# weather in terminal
curl -4 http://wttr.in/Santa_Fe
@srvanrell
srvanrell / TeX.gitignore
Last active July 27, 2016 18:18 — forked from kogakure/.gitignore
Git: .gitignore file for LaTeX projects
*.acn
*.acr
*.alg
*.aux
*.bak
*.bbl
*.blg
*.dvi
*.glg
*.glo