(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
#!/usr/bin/env python3 | |
""" Script to fetch the data from the server and store in a csv file. | |
ARGS: | |
- SQL query to parse. | |
- filename to store the data to in the csv format. | |
OUTPUT: | |
- csv file with the data.""" |
import os | |
import unittest | |
import shutil | |
from setuptools import setup | |
from setuptools import Command | |
from dashboard import __version__ | |
try: | |
import coverage | |
except ImportError: |
import logging | |
logger = logging.getLogger(__name__) | |
def log_decorator(funk): | |
def wrapper(data, **kwargs): | |
before = data.shape[0] | |
data = funk(data, **kwargs) | |
after = data.shape[0] | |
logger.info("Excluded {} rows, remaining {}".format(before - after, after)) | |
return data |
" Configuration file for vim | |
" To customize it, copy to ~/.vimrc and edit! | |
set nocompatible " Use Vim defaults (much better!) | |
set bs=2 " allow backspacing over everything in insert mode | |
set history=50 " keep 50 lines of command line history | |
set textwidth=0 " Don't wrap words by default | |
set ruler " Show the line and column numbers of the cursor |
[user] | |
name = <name> | |
email = @gmail.com | |
username = <username> | |
[core] | |
editor = vim | |
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
[web] | |
browser = google-chrome |
import pandas as pd | |
import mysql.connector.pooling | |
start_cred = { | |
'db_user': <db_user>, | |
... | |
} | |
cnx = mysql.connector.pooling.MySQLConnectionPool(**start_cred) | |
data = pd.read_csv('filename') |
from sklearn.metrics import r2_score, mean_squared_error | |
import matplotlib.lines as mlines | |
import matplotlib.transforms as mtransforms | |
def stats(value, pred): | |
res = [ | |
{ | |
'metric': 'R2', | |
'value' : r2_score(value, pred) | |
} |