| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
A pattern for building personal knowledge bases using LLMs. Extended with lessons from building agentmemory 20K+ Stars ⭐️, a persistent memory engine for AI coding agents.
This builds on Andrej Karpathy's original LLM Wiki idea file. Everything in the original still applies. This document adds what we learned running the pattern in production: what breaks at scale, what's missing, and what separates a wiki that stays useful from one that rots.
The core insight is correct: stop re-deriving, start compiling. RAG retrieves and forgets. A wiki accumulates and compounds. The three-layer architecture (raw sources, wiki, schema) works. The operations (ingest, query, lint) cover the basics. If you haven't read the original, start there.
TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.
If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)
A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/
The reason to avoid JWTs comes down to a couple different points:
| <# | |
| Run on the Central | |
| #> | |
| # Connect to Qlik Sense | |
| # See https://github.com/ahaydon/Qlik-Cli/wiki/Establishing-a-connection for more connection options | |
| Connect-Qlik | |
| # Add the Node to the Cluster; store the password element of the response for the ZIP as $password | |
| # nodePurpose: 0 (Production) / 1 (Development) / 2 (Both) | |
| # engineEnabled, proxyEnabled, schedulerEnabled, $printingEnabled, $failoverCandidate as options | |
| $password = New-QlikNode -hostname qlikserver2.domain.local -name qlikserver2 -nodePurpose 0 -engineEnabled -proxyEnabled |
| # Description: Boxstarter Script | |
| # Author: Jess Frazelle <jess@linux.com> | |
| # Last Updated: 2017-09-11 | |
| # | |
| # Install boxstarter: | |
| # . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
| # | |
| # You might need to set: Set-ExecutionPolicy RemoteSigned | |
| # | |
| # Run this boxstarter by calling the following from an **elevated** command-prompt: |
| #!/usr/bin/env bash | |
| set -e | |
| CONTEXT="$1" | |
| if [[ -z ${CONTEXT} ]]; then | |
| echo "Usage: $0 KUBE-CONTEXT" | |
| exit 1 | |
| fi |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
| var qsocks = require('qsocks'); | |
| var Promise = require('bluebird'); | |
| var fs = require('fs-extra'); | |
| var config = { | |
| isSecure: true, | |
| host: '<HOSTNAME>', | |
| port: 4747, | |
| headers: { | |
| 'X-Qlik-User': 'UserDirectory=Internal;UserId=sa_repository' |
| var qsocks = require('qsocks') | |
| var serializeApp = require('serializeapp') | |
| var fs = require('fs-extra') | |
| var Promise = require('promise') | |
| function create(docname) { | |
| qsocks.Connect({appname: docname}) | |
| .then(function(global) { | |
| return global.openDoc(docname) | |
| }) |