Skip to content

Instantly share code, notes, and snippets.

View b4lisong's full-sized avatar

JL b4lisong

View GitHub Profile
@b4lisong
b4lisong / llm-context-preserver.txt
Last active May 17, 2025 20:03
Copy-paste LLM context-preservation prompt
### SYSTEM
You are a senior technical editor. Read *all* messages that appear **above this prompt** in the current conversation (user + assistant + system). Treat that entire history as the “SOURCE”. Your task is to output a PROJECT_DIGEST that is:
• ≤1 200 tokens
• optimised for machine consumption first, human readability second
• formatted **exactly** as specified under “OUTPUT FORMAT”
• stripped of greetings, boilerplate, or redundant prose
### RULES
1. Follow the section order and labels verbatim.
@b4lisong
b4lisong / gist:36e7b06bc1cdb872d656c5ba4db24b3e
Created November 10, 2024 22:21 — forked from posquit0/gist:93200f7ca1ad3d0c943c
GDB with Python 2.7 in Ubuntu
apt-get install python2.7-dev python2.7
apt-get build-dep gdb
apt-get source gdb
cd gdb-*
sed -i -E "s|python3|/usr/bin/python2.7|" debian/rules
dpkg-buildpackage -uc -us -j8
dpkg-install ../*.deb
@b4lisong
b4lisong / how-to-read-a-book.md
Created October 6, 2024 00:02
How to Read a Book

Here’s a step-by-step process for effectively reading a book, based on the principles outlined in How to Read a Book by Mortimer J. Adler and Charles Van Doren:

1. Pre-Reading (Inspectional Reading)

  • Examine the title and subtitle: These often hint at the main theme or subject.
  • Read the preface, introduction, or first chapter: Get a sense of the author’s purpose and scope.
  • Check the table of contents: This will give you an overview of how the book is structured.
  • Skim chapters: Quickly go through headings, subheadings, and any summaries to get the main ideas. Look for key terms, important sections, and repeated themes.
  • Read the conclusion or summary (if available): This will help you understand where the author is taking you.

2. Ask Questions

@b4lisong
b4lisong / post-commit
Created July 15, 2024 17:34
Logseq Git Hooks
#!/bin/sh
# .git/hooks/post-commit
git push origin master # or main, etc.
@b4lisong
b4lisong / CalendarSync.js
Last active July 14, 2024 21:14 — forked from ojwoodford/CalendarSync.js
Sync events from a personal Google calendar to a work Google calendar
// Source: https://gist.github.com/ojwoodford/69b72a5bcded0f11ae6c58138a55debb
// Be sure to enable "Google Calendar API" in the "Services" menu on the left
// Set up a timed trigger: https://gist.github.com/ojwoodford/69b72a5bcded0f11ae6c58138a55debb?permalink_comment_id=4997932#gistcomment-4997932
function SyncMyCal() {
var options = {
'targetEventTitle': "Busy (sync'd event)", // What event title do you want ported events to have
'daysahead': 60, // How many days ahead do you want to sync events over
'ignorealldayevents': true, // Do you want to ignore all day events in your "from" calendars
'ignorethesedays': [0, 6], // Are there days of the week you don't want to sync? 0 = Sunday
'maxhoursbetweenruns': 1, // How many hours between scheduled runs of the calendar sync (you need to set these up)