-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
shane0
committed
Dec 20, 2024
1 parent
b077820
commit f0e7fbd
Showing
11 changed files
with
293 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 12 Dec | ||
|
||
- reflecting on 2024 great year | ||
- level 2 is done! | ||
- starting level 3 | ||
- starting a new clean branch for notes | ||
|
||
## choose samsara or the path? | ||
|
||
<iframe width="1145" height="644" src="https://www.youtube.com/embed/KFjC1yG1N5Q?list=PLGY2UhH7nNtLUtjap8EvMUU9ohIHU3f6x" title="Buddhism vs. The World" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> | ||
|
||
## six dusts | ||
|
||
In Buddhism, guarding the six sense doors is a practice of mindfulness and restraint to prevent unwholesome mental states from arising. This is called **sense restraint** (*indriya-saṃvara* in Pali). The "guards" for the six sense doors are mindfulness, wisdom, and discernment, which help one maintain control over the sensory experiences. Here’s how this works for each sense base: | ||
|
||
### 1. **Mindfulness (Sati)** | ||
|
||
- **Purpose:** To be fully aware of sensory experiences as they arise. | ||
- **How:** Mindfulness helps you notice the moment a sense object (e.g., a sight, sound, or thought) arises and prevents automatic, unwholesome reactions like craving or aversion. | ||
|
||
### 2. **Wisdom (Paññā)** | ||
|
||
- **Purpose:** To discern the impermanent, unsatisfactory, and non-self nature of sensory experiences. | ||
- **How:** Wisdom provides insight into the true nature of phenomena, helping to reduce attachment or aversion to them. | ||
|
||
### 3. **Guarding the Eye (Cakkhu)** | ||
|
||
- Being mindful of what is seen, avoiding unwholesome sights or reactions (e.g., lust, envy). | ||
|
||
### 4. **Guarding the Ear (Sota)** | ||
|
||
- Being mindful of what is heard, avoiding unwholesome sounds or reactions (e.g., gossip, anger). | ||
|
||
### 5. **Guarding the Nose (Ghana)** | ||
|
||
- Being mindful of smells, avoiding clinging to pleasant scents or aversion to unpleasant ones. | ||
|
||
### 6. **Guarding the Tongue (Jivha)** | ||
|
||
- Being mindful of tastes, avoiding overindulgence or aversion. | ||
|
||
### 7. **Guarding the Body (Kaya)** | ||
|
||
- Being mindful of physical sensations, recognizing the arising of pleasure, pain, or neutrality without clinging or aversion. | ||
|
||
### 8. **Guarding the Mind (Mano)** | ||
|
||
- Being vigilant about thoughts, avoiding unwholesome mental proliferations (e.g., greed, hatred, delusion). | ||
|
||
By practicing sense restraint, one prevents the mind from becoming overwhelmed by desires, aversions, or distractions, which is essential for cultivating inner peace and progressing on the path to enlightenment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
timestamp,level,module,message | ||
2024-12-14T10:47 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py bujo loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py bujo loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py h loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py h loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py i loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py i loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py m loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py m loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py s loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py s loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py s loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py s | ||
2024-12-14T10:47 - INFO - Loading command: s | ||
2024-12-14T10:47 - INFO - cli.py s loaded successfully. | ||
2024-12-14T10:47 - INFO - cli.py s | ||
2024-12-14T10:47 - INFO - cli.py s s | ||
2024-12-14T10:47 - INFO - Loading command: s | ||
2024-12-19T17:33 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T17:33 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T17:33 - INFO - cli.py bujo | ||
2024-12-19T17:33 - INFO - cli.py bujo | ||
2024-12-19T17:33 - INFO - cli.py bujo bujo | ||
2024-12-19T17:33 - INFO - cli.py bujo bujo | ||
2024-12-19T17:33 - INFO - Loading command: bujo | ||
2024-12-19T17:33 - INFO - Loading command: bujo | ||
2024-12-19T18:04 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py i loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py i loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py m loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py m loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h | ||
2024-12-19T18:04 - INFO - Loading command: h | ||
2024-12-19T18:04 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py buddhism loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py bujo loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py h loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py i loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py i loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py m loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py m loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s | ||
2024-12-19T18:04 - INFO - Loading command: s | ||
2024-12-19T18:04 - INFO - cli.py s loaded successfully. | ||
2024-12-19T18:04 - INFO - cli.py s | ||
2024-12-19T18:04 - INFO - cli.py s s | ||
2024-12-19T18:04 - INFO - Loading command: s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# plugins/mods/log_tools.py | ||
# plugins/mods/log_tools.py | ||
import os | ||
import logging | ||
import csv | ||
from datetime import datetime | ||
|
||
# Ensure the log directory exists | ||
log_dir = 'plugins/logs' | ||
if not os.path.exists(log_dir): | ||
os.makedirs(log_dir) | ||
|
||
# Path to the log file | ||
log_file = os.path.join(log_dir, 'cli_logs.csv') | ||
|
||
# Set up logging | ||
def setup_logger(level=logging.DEBUG): | ||
""" | ||
Set up a logger that logs to a CSV file. | ||
Uses the module's name dynamically for the logger name. | ||
""" | ||
# Get the name of the current module (i.e., the script that is calling this function) | ||
module_name = __name__.split('.')[-1] # This gives just the module name, not the full path | ||
logger = logging.getLogger(module_name) | ||
logger.setLevel(level) | ||
|
||
# Create a formatter with ISO format for date and time | ||
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%dT%H:%M') | ||
|
||
# File handler to write logs to a CSV file | ||
file_handler = logging.FileHandler(log_file) | ||
file_handler.setFormatter(formatter) | ||
|
||
# Add the file handler to the logger | ||
logger.addHandler(file_handler) | ||
|
||
# Ensure the CSV header is written if the file is empty | ||
if os.stat(log_file).st_size == 0: | ||
with open(log_file, 'w', newline='') as csvfile: | ||
writer = csv.writer(csvfile) | ||
writer.writerow(['timestamp', 'level', 'module', 'message']) | ||
|
||
return logger | ||
|
||
# Log to CSV function (write directly to CSV format) | ||
def log_to_csv(level, module, message): | ||
with open(log_file, 'a', newline='') as csvfile: | ||
writer = csv.writer(csvfile) | ||
timestamp = datetime.now().strftime('%Y-%m-%dT%H:%M') | ||
writer.writerow([timestamp, level, module, message]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// https://learn.nucamp.co/mod/page/view.php?id=5548 | ||
// https://eloquentjavascript.net/3rd_edition/03_functions.html#h_XqQR5FlX+8 | ||
let x = 10; | ||
if (true) { | ||
let y = 20; | ||
var z = 30; | ||
console.log(x + y + z); | ||
// → 60 | ||
} | ||
// y is not visible here | ||
console.log(x + z); | ||
// → |