Step-by-step guide for building the Claude Code CLI from the alesha-pro/claude-code repository — leaked Anthropic Claude Code source code.
- Linux (Ubuntu 22.04+) or macOS
- 4GB RAM, 4 CPU cores, 30GB disk
- Bun >= 1.3
- Git
Step-by-step guide for building the Claude Code CLI from the alesha-pro/claude-code repository — leaked Anthropic Claude Code source code.
| // ==UserScript== | |
| // @name Keyboard Shortcut Scripts | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Run scripts with keyboard shortcuts | |
| // @match *://*/* | |
| // @grant none | |
| // ==/UserScript== | |
| // Parameters |
COMMENTS VERY WELCOME! this is a first pass to put these ideas in one place
tldr - combine obsidian + openinterpreter to create a bespoke pkm copilot experience. if you follow the "file over app" philosophy, this combination can be your lifetime AI companion
| //credit - https://huggingface.co/blog/fine-tune-wav2vec2-english (Patrick von Platen) | |
| // run this on your Chrome / Browser Console (where Colab is present) | |
| function ConnectButton(){ | |
| console.log("Connect pushed"); | |
| document.querySelector("#top-toolbar > colab-connect-button").shadowRoot.querySelector("#connect").click() | |
| } | |
| var colab = setInterval(ConnectButton,60000); |
| function toBaseN(num, base) { | |
| if (num === 0) { | |
| return '0'; | |
| } | |
| var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| var len = Math.min(digits.length, base); | |
| var result = ''; | |
| while (num > 0) { | |
| result = digits[num % len] + result; | |
| num = parseInt(num / len, 10); |
| // Promises are started in parallel. | |
| // Resolves with the first resolved value in array order. | |
| // If there's no winner, it rejects with last rejection. | |
| Promise.preferred = function (promisesOrdered) { | |
| return new Promise((resolve, reject) => { | |
| var resolvedValues = new WeakMap(); | |
| var resolvables = promisesOrdered.slice(); // copy | |
| function onMemberResolved(value, member) { | |
| resolvedValues.set(member, value); | |
| if (member == resolvables[0]) |
| // | |
| // Simple generator (with co) VS async/await benchmark | |
| // Article: https://medium.com/p/806d8375a01a | |
| // | |
| const co = require('co'); | |
| const Benchmark = require('benchmark'); | |
| const suite = new Benchmark.Suite; | |
| // add tests |
| // Promises are started in parallel. | |
| // Resolves with the first resolved value in time. | |
| // If there's no winner, it rejects with last rejection. | |
| Promise.any = function (promises) { | |
| return new Promise((resolve, reject) => { | |
| var rejectedCount = 0; | |
| function onMemberResolved(value) { | |
| resolve(value); | |
| } | |
| function onMemberRejected(reason) { |
| @interface BLZLabelWithInset : UILabel | |
| @property (nonatomic) UIEdgeInsets insets; | |
| @end |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent