Skip to content

Instantly share code, notes, and snippets.

View prameshbajra's full-sized avatar
💻
Let's talk tech.

Pramesh Bajracharya prameshbajra

💻
Let's talk tech.
View GitHub Profile
@prameshbajra
prameshbajra / Python Virtual Env
Last active December 6, 2020 14:53
My personal python environment setup.
virtualenv venv -p python3.6
// Activate the created venv ...
pip install ipykernel
pip install notebook
pip install jupyter_contrib_nbextensions
pip install autopep8
pip install yapf
@prameshbajra
prameshbajra / Jupyter Notebook Dank Mono.css
Last active August 28, 2020 11:21
Dank Mono Entities
div#notebook {
color: #f8f8f0;
font-family: 'Dank Mono' sans-serif; font-style:italic;
font-size: 9pt;
line-height: 170%;
padding-top: 25px !important;
zoom: 110%;
-webkit-font-smoothing: antialiased !important;
}
@prameshbajra
prameshbajra / settings.json
Created September 1, 2020 08:10
VSCode workspace configuration for Python projects.
// This is configuration for VSCode such that the `go to definitions` work for the current project.
// Side Note: The PYTHONPATH for the current project was set.
{
"python.formatting.provider": "autopep8",
"python.linting.enabled": true,
"python.pythonPath": "<VENV_PATH>\\Scripts\\python.exe",
"python.languageServer": "Microsoft"
}
@prameshbajra
prameshbajra / pramesh.omp.json
Created June 20, 2021 07:33
Oh my posh configuration file. Needs nerd fonts to work flawlessly.
{
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "session",
"style": "diamond",
"foreground": "#ffffff",
@prameshbajra
prameshbajra / CriteriaToSQL.java
Created May 3, 2024 03:00
CriteriaQuery to SQL print.
org.hibernate.Session session = entityManager.unwrap(org.hibernate.Session.class);
org.hibernate.query.Query<?> query = session.createQuery(criteriaQuery);
SharedSessionContractImplementor sessionImplementor = entityManager.unwrap(SharedSessionContractImplementor.class);
String sql = sessionImplementor.getFactory()
.getQueryPlanCache()
.getHQLQueryPlan(query.getQueryString(), false, Collections.emptyMap())
.getSqlStrings()[0];