Skip to content

Instantly share code, notes, and snippets.

View cosmic-byte's full-sized avatar
🎯
Focusing

Greg obinna cosmic-byte

🎯
Focusing
View GitHub Profile
@staticmethod
def get_logged_in_user(new_request):
# get the auth token
auth_token = new_request.headers.get('Authorization')
if auth_token:
resp = User.decode_auth_token(auth_token)
if not isinstance(resp, str):
user = User.query.filter_by(id=resp).first()
response_object = {
'status': 'success',
from functools import wraps
from flask import request
from app.main.service.auth_helper import Auth
def token_required(f):
@wraps(f)
def decorated(*args, **kwargs):
@cosmic-byte
cosmic-byte / tmux-cheat-sheet.md
Created September 5, 2019 08:19 — forked from michaellihs/tmux-cheat-sheet.md
tmux Cheat Sheet
@cosmic-byte
cosmic-byte / tmux.md
Created September 9, 2019 12:37 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a