VIM CheatSheet
Based on configuration provided in .config/nvim/init.vim
Glossary
- L = Leader Key, mapped to a single space " "
- C = Control
- S = Shift
Based on configuration provided in .config/nvim/init.vim
""" | |
Usage: | |
wait time: 600 (10 minutes) | |
title: 'Hello World' | |
duration: 7200 (2 hours) | |
$ python countdown.py 600 'Titulo da Live' 7200 | |
""" | |
import os | |
import sys |
Run
python vertabelo_flask_sqlalchemy.py -i codefoods.xml -o models.py
Original vertabelo project https://my.vertabelo.com/public-model-view/NpylPJx6kCkty9TmOE8z6XtqhYLqV570wPuSIgSwMoUUQp1Cofk8GXvaNOq3NFAO?x=4005&y=4384&zoom=0.6653
fn main() { | |
let vec_opt = [Some(1), Some(2), Some(3)].iter().copied().collect::<Vec<Option<i32>>>(); | |
let opt_vec = [Some(1), Some(2), Some(3)].iter().copied().collect::<Option<Vec<i32>>>(); | |
println!("{:?}", vec_opt); | |
println!("{:?}", opt_vec); | |
} |
""" | |
Poker Ranker for Exercism.io | |
""" | |
def best_hands(hands): | |
hands = serialize(hands) | |
return [ | |
deserialize(hand) | |
for hand in hands |
from dynaconf import LazySettings | |
settings = LazySettings( | |
# you can pass also default values for settings | |
FOO="bar", | |
# You can also pass Dynaconf configuration oprions | |
# .: Those ending with `_FOR_DYNACONF`: docs/guides/configuration.html | |
ENVVAR_PREFIX_FOR_DYNACONF="MYPROJECTNAME", | |
# You can also change order of loaders | |
LOADERS_FOR_DYNACONF=[ |
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python (Updated for Python 3.7) | |
Usage: | |
./dummy-web-server.py -h | |
./dummy-web-server.py -l localhost -p 8000 | |
Send a GET request: |
#!/usr/bin/env sh | |
file=/tmp/cmus_playing.txt | |
while true | |
do | |
music="" | |
if cmus-remote -C status | grep -q playing; then | |
music=$(cmus-remote -Q | grep -e "tag title" -e "tag artist" | sed "s/^tag\s\w*\s//g" | sed "N;s/\n/ - /g") | |
if (( ${#music} > 0 )); then | |
music="Now playing: $music" | |
fi |
""" | |
sudo systemcrl start sendmail | |
""" | |
import smtplib | |
from dynaconf import settings | |
def get_email_server(): | |
"""Creates an instance of email server. |
-- Save this file to ~/.config/micro/init.lua | |
-- requirements: | |
-- Python3 | |
-- - isort | |
-- - black | |
-- - flake8 | |
-- - ipython | |
-- Rust | |
-- - cargo-play | |
-- - evcxr_repl |