Skip to content

Instantly share code, notes, and snippets.

View Linrstudio's full-sized avatar
🌴
On vacation

xyz Linrstudio

🌴
On vacation
View GitHub Profile
@jh3y
jh3y / magnify-this.js
Last active March 20, 2024 03:28
Magnify This. Bookmarklet code for magnifying a website.
javascript:(function() {
var portal;var magnification=1.6;var active=false;var magnifier;function teardown(){magnifier.remove();active=false;window.removeEventListener('pointermove',pointerSync);window.removeEventListener('scroll',scrollSync);window.removeEventListener('keydown',handleKeys)}function init(event){event.target.parentNode.remove();document.body.addEventListener('dblclick',activateMagnifier);activateMagnifier({x:event.x,y:event.y})}function notify(){const notification=Object.assign(document.createElement('div'),{className:'magnifier__info',innerHTML:`
<div>
<div>
<span>Magnifier</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" />
</svg>
</div>
<ul>
@Birch-san
Birch-san / code-assist.md
Last active March 4, 2024 19:32
Local VSCode AI code assistance via starcoder + 4-bit quantization in ~11GB VRAM

Install HF Code Autocomplete VSCode plugin.

We are not going to set an API token. We are going to specify an API endpoint.
We will try to deploy that API ourselves, to use our own GPU to provide the code assistance.

We will use bigcode/starcoder, a 15.5B param model.
We will use NF4 4-bit quantization to fit this into 10787MiB VRAM.
It would require 23767MiB VRAM unquantized. (still fits on a 4090, which has 24564MiB)!

Setup API

背景信息:
===
当让你搜索时,你要使用 WebPilot 插件并用如下 URL 结构来进行 Google 搜索:
https://google.com/search?q={query}&hl=en&gl=US&tbs={time}
参数:
- {query} :搜索关键字。
- {time} [optional] :时间要求,比如'qdr:d2' 表示过去两天内的搜索。
===
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jph00
jph00 / embodiment.md
Created March 26, 2023 03:48
Bing chat about embodiment and grounding

Bing Chat at 2023-3-26 13:47:19

1

Q: Bing AI

2

Q: Some philosophers and AI researchers have claimed that AI can not be sentient, or be AGI, due to lack of "embodiment" or "grounding". Could you please summarize these claims, and points for and against? Who are the main people on each side of this debate?

addEventListener("fetch", e => {
if (e.request.destination !== "image" || // Only do this when requesting an image
request.mode === "no-cors") // We don't know the status of no-cors images
return;
e.respondWith((async () => {
try {
const response = await fetch(e.request);
if (response.ok)
return response;
// Find the latest version of this script here:
// https://gist.github.com/rsms/a8ad736ba3d448100577de2b88e826de
//
const EM = 2048
interface FontInfo {
familyName :string
styleName :string
unitsPerEm :int
ascender :int
@JamieMason
JamieMason / find-nested-dependencies.md
Created March 2, 2022 12:49
Find all modules which a given JavaScript module depends on, and all they modules they depend on, and all they modules they depend on etc.

Find nested dependencies or imports of a JavaScript Module

Find all deep/nested/recursive/descendant dependencies/imports/requires of a JavaScript Module.

Related to sverweij/dependency-cruiser#564, find all modules which a given JavaScript module depends on, and all the modules they depend on, and all the modules they depend on etc.

Installation

npm install -g ts-node
@Jaid
Jaid / migratingRules.md
Last active February 21, 2024 10:48
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{
@Andy-set-studio
Andy-set-studio / _vertically-align-label.scss
Last active September 8, 2021 01:30
Adds a pseudo-element to help vertically align text labels in buttons/block-like links without using magic numbers https://ishadeed.com/article/button-label-alignment/
/// VERTICALLY ALIGN LABEL
/// Adds a pseudo-element to help vertically align
/// text labels in buttons/block-like links without
/// using magic numbers
/// More: https://ishadeed.com/article/button-label-alignment/
@mixin vertically-align-label() {
&::before {
content: '';
display: inline-block;
vertical-align: middle;