Skip to content

Instantly share code, notes, and snippets.

View CheeksTheGeek's full-sized avatar
🏠
Working from home but not really home

Chaitanya Sharma CheeksTheGeek

🏠
Working from home but not really home
View GitHub Profile
@CheeksTheGeek
CheeksTheGeek / flask-cookbook-template.md
Created September 28, 2023 18:39
Best way for a flask cookbook for Jupyter

Use these markdown code blocks in the actual cells in the jupyter notebook

First cell, to be run when reinstantiaiton is needed

Note: you can add the most used libs here

inst_flask = '''from flask import Flask
app = Flask(__name__)'''
exec(inst_flask, globals(), locals()) # added globals and locals to make it work in jupyter notebook, as it is not a script and hence does not have global and local variables
# make a lambda function for run_app which fills in the number in port parameter of run method 
run_app = lambda port=None,host=None, debug=None, load_dotenv=True, : exec(f'''if __name__ == "__main__": 
@CheeksTheGeek
CheeksTheGeek / render-local-image-alt-text.css
Created June 3, 2023 20:19
CSS snippet for obsidian to render alt text image
.image-embed[alt]:after {
content: attr(alt);
display: block;
margin: 0.2rem 1rem 1rem 1rem;
font-size: 90%;
line-height: 1.4;
color: var(--text-faint);
}
@CheeksTheGeek
CheeksTheGeek / md-align-obsidian.css
Last active May 21, 2023 20:37
how to get a wider view on the obsidian editor but not the ugly view which a turned off readable line length option gives
.markdown-source-view, .markdown-preview-view {
max-width: 1200px; /* change this according to whatever */
margin: auto;
}
/*
save this snippet as a file in your .obsidian/snippets path inside your obsidian vault
and then go to obsidian settings > Editor > Display > turn off readable line length

Keybase proof

I hereby claim:

  • I am cheeksthegeek on github.
  • I am cheeksthegeek (https://keybase.io/cheeksthegeek) on keybase.
  • I have a public key ASAreqGZuX6OBPlZndil-Xd9_ekAz3z4zeF0dZ2pz-Hp7go

To claim this, I am signing this object: