-
Install pandas to local directory with pip:
pip install -t . pandas
-
Remove pandas and numpy directories
rm -r pandas numpy
-
Download the Linux distribution for pandas (choose the Python version that you want to use): https://pypi.org/project/pandas/#files
-
Download the Linux distribution for numpy (must be the same as the pandas one): https://pypi.org/project/numpy/#files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"python.pythonPath": "/Users/antoine.delia/.pyenv/versions/3.9.0/bin/python", | |
"python.formatting.autopep8Args": ["--max-line-length", "100"], | |
"python.linting.pylintEnabled": false, | |
"python.linting.flake8Enabled": true, | |
"python.linting.enabled": true, | |
"python.linting.flake8Args": [ | |
"--max-line-length", "200" | |
], | |
"autoDocstring.docstringFormat": "sphinx", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open the current cmd path to the current VS Code window | |
code . -r | |
# Print the result of a command in bash | |
echo $(operation) | |
# Pretty print json output in bash | |
echo '{"first_name":"Antoine","last_name":"Delia"}' | python -m json.tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: service-name | |
provider: | |
name: aws | |
stage: ${opt:stage, 'prod'} | |
runtime: ${opt:runtime, 'python3.8'} | |
region: ${opt:region, 'eu-west-1'} | |
deploymentBucket: | |
name: deployment_bucket_name | |
iamRoleStatements: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fields @timestamp, @message, @logStream | |
| parse @message "[*][*] *" as loggingTime, loggingType, loggingMessage | |
| filter loggingType in ["ERROR", "WARNING", "DEBUG", "INFO"] | |
| display loggingTime, loggingType, loggingMessage | |
| filter loggingMessage like "my search criteria" | |
| sort @timestamp desc | |
| limit 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO") | |
LOG_FILE_NAME = os.getenv("LOG_FILE_NAME", "log.txt") | |
class Color: | |
"""An enum for the different colors available for printing | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm.sendRequest({ | |
url: "https://YOUR_COGNITO_DOMAIN_NAME_HERE.auth.eu-west-1.amazoncognito.com/oauth2/token", | |
method: 'POST', | |
header: { | |
'Content-Type': 'application/x-www-form-urlencoded' | |
}, | |
body: { | |
mode: 'urlencoded', | |
urlencoded: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from timeit import repeat | |
setup = 'x = ("a", "b", "c", "d"); idx = 2' | |
stmt_range = """ | |
[x[i] for i in range(len(x)) if i != 2] | |
""" | |
stmt_slice = """ | |
list(x[:2] + x[3:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.fosshub.com/MKVToolNix.html | |
$ sudo apt install mkvtoolnix | |
# Update the default audio track to the second one in all the files in the current directory | |
$ for i in *; do if [[ $i == *.mkv ]]; then mkvpropedit "$i" --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1; fi; done | |
# If you have a single subtitle, and you want it to be default, then do: | |
$ for i in *; do if [[ $i == *.mkv ]]; then mkvpropedit "$i" --edit track:s1 --set flag-default=1; fi; done | |
# Merge two files into one |
Things I learned while doing Advent of Code 2022
itertools.accumulate
string.ascii_letters
complex
typemax
functionlocals
- Modular arithmetics
- Basic regex to find numbers
OlderNewer