Skip to content

Instantly share code, notes, and snippets.

View bolinocroustibat's full-sized avatar

Adrien Carpentier bolinocroustibat

View GitHub Profile
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
import toml
config = toml.load("./pyproject.toml")
# Sentry error logging
app_name = config["tool"]["poetry"]["name"]
version = config["tool"]["poetry"]["version"]
sentry_sdk.init(
@bolinocroustibat
bolinocroustibat / samesite_cookie_compatibility.py
Last active March 17, 2020 07:02
Python/Django SameSite cookie middleware and compatibility class
@bolinocroustibat
bolinocroustibat / gitignore_global.txt
Last active February 7, 2019 23:15
Global .gitignore
#Ignore thumbnails created by windows
Thumbs.db
#Ignore MacOS files
*.DS_Store
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
@bolinocroustibat
bolinocroustibat / tslint.json
Created February 7, 2019 21:01
Linting rules for TypeScript projects
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
@bolinocroustibat
bolinocroustibat / !note
Last active February 7, 2019 21:05
Apache + Python venv + Django: module not found
module 'django_project' not found
=> Logiquement et après seulement un an de recherche il faut ajouter le dir au python path.
Normalement il suffit de faire un export PYTHONPATH="${PYTHONPATH}:/var/www/django_project"
mais ca marche que en shell, pas en apache/venv
DONC => Créer un "nano /var/www/venv/spie/lib/python3.5/site-packages/django_project.pth" (fichier .pth)
Dans lequel on met le ou les paths "/var/www/django_project" ici
@bolinocroustibat
bolinocroustibat / settings.json
Created February 7, 2019 20:37
VS Code settings
{
"workbench.colorTheme": "Dracula Soft",
"gitlens.advanced.messages": {
"suppressShowKeyBindingsNotice": true
},
"workbench.iconTheme": "vscode-icons",
// Controls the font size in pixels.
"editor.fontSize": 14,
"editor.wordWrap": "on",
"editor.renderWhitespace": "all",
@bolinocroustibat
bolinocroustibat / Preferences.sublime-settings
Created February 7, 2019 20:35
Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"draw_white_space": "all",
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
"open_files_in_new_window": false,
"show_encoding": true,