Skip to content

Instantly share code, notes, and snippets.

@MahmadSharaf
MahmadSharaf / JsonToNotes.js
Created October 14, 2025 19:18
QuickAdd User Scripts
// --- SETTINGS KEYS ---
const INPUT_VARIABLE = "Input Variable Name (contains JSON)";
const TEMPLATE_CHOICE_NAME = "Template Choice to Run for Each Item";
const POST_ACTION_CHOICE_NAME = "Post-Processing Choice Name (optional)";
module.exports = {
entry: async (params, settings) => {
const { quickAddApi, variables } = params;
// --- Get Settings ---
@MahmadSharaf
MahmadSharaf / viewer-webengine.json
Last active August 9, 2022 11:52
Calibre Viewer Style
{
"configure-viewer-toolbar-geometry": {
"__class__": "bytearray",
"__value__": "AdnQywADAAAAAAZKAAABpwAACLUAAAPJAAAGSwAAAcYAAAi0AAADyAAAAAAAAAAACgAAAAZLAAABxgAACLQAAAPI"
},
"local_storage": {
"simple_input_history_net_search_url": [
"https://google.com/search?q={q}"
]
},
@MahmadSharaf
MahmadSharaf / hansselman.omp.json
Created August 8, 2022 19:19
hansselman modified
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#ff479c",
"foreground": "#ffffff",
"leading_diamond": "\ue0b6",
@MahmadSharaf
MahmadSharaf / Microsoft.PowerShell_profile.ps1
Created January 18, 2022 20:57
Python Virtual Environment Wrapper for PowerShell
# Adding this script to PS profile allows quick actions for Python venv library.
# Create a variable where virtual environments are located
$VENV_HOME="$HOME\.virtualenvs\"
# A function to list all available virtual environments
function Get-Venvs{
Get-ChildItem -Path $VENV_HOME -Name
}
@MahmadSharaf
MahmadSharaf / python_decorator_guide.md
Created April 25, 2018 18:56 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].