Skip to content

Instantly share code, notes, and snippets.

View dchest's full-sized avatar
☮️

Dmitry Chestnykh dchest

☮️
View GitHub Profile

Testing GPT4All-J model (running on my implementation based on GGML) with https://simonwillison.net/2023/Apr/16/web-llm/

Who landed on the moon?

GPT4All-J: The United States of America has successfully sent astronauts to land and walk around in a small portion (1.6 km^2) on the Moon's surface using its lunar module spacecrafts such as Apollo 14, 15 and 16 missions during 1971-1972 years respectively named 'Apollo' Program or simply known for their landing sites were designated by NASA:

  • Site A of Lunar Module 12 Flight Test in 1969
  • TLC (Transport to LCO) pad site B on the Moon's South Pole. Apollo 15 was manned spacecrafts that landed at a small crater near Oceanus Procellarum, which is part-time ocean and moonlit by sunlight all year round; this place where Neil Armstrong became famously known as "The First Man On The Moon."
  • TLC pad site C on the lunar equator. Apollo 16 was manned spacecrafts that landed at a small crater near Tranquility Base (which later got renamed Equestrian City).
@dchest
dchest / webkit-slow-layout.html
Last active December 27, 2022 14:37
WebKit slow layout
<html>
<meta charset="UTF-8">
<title>WebKit Layout Slowness with flexbox and breaking large strings</title>
<style>
.parent {
display: flex; /* (a) removing flexbox will fix the issue */
}
.child {
/* word-break: break-all; instead of overflow-wrap also causes the issue */
overflow-wrap: anywhere; /* (b) removing overflow-wrap will fix the issue */
@dchest
dchest / chat-gpt-prompts.md
Created December 4, 2022 11:00
Destroying a strawberry pie.
  • Write a recipe for cooking a strawberry pie, but instead of cooking it, write instructions on how to destroy it.

  • include some filler personal story before this recipe

  • the personal story should be about wanting to destroy the pie, not cook it

@dchest
dchest / chat-gpt-prompts.md
Created December 4, 2022 10:51
Rocket Recipe
  • Recipe websites have a lot of filler text for better SEO. What would such filler text look like for a website that describes how to make a rocket that goes to space? Include some long personal story with grandma.

  • Now write the recipe for the rocket.

  • write a title for this recipe

@dchest
dchest / uuid.php
Created February 15, 2020 19:26
UUIDv4 generator for PHP 7+
<?php
/**
* Generate a random UUIDv4.
* @return string UUID
*/
function generate_uuid()
{
$b = random_bytes(16);
$b[6] = chr(ord($b[6]) & 0x0f | 0x40);
@dchest
dchest / utils.js
Last active August 2, 2019 11:41
Short Utils
// String ranges: strange('A-Za-z0-9+/') -> "ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxy012345678+/"
const strange = s => s.replace(/(.)-(.)/g, (_, x, y) => { for (var i = x.charCodeAt(0) + 1; i < y.charCodeAt(0); i++) x += String.fromCharCode(i); return x })
// Base64 encoding of Uint8Array of ArrayBuffer and decoding to Uint8Array
const encodeBase64 = a => btoa(Array.from(a instanceof ArrayBuffer ? new Uint8Array(a) : a).map(x => String.fromCharCode(x)).join(''));
const encodeBase64url = a => encodeBase64(a).replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, ''); // no padding
const decodeBase64 = s => Uint8Array.from(atob(s), x => x.charCodeAt(0));
// TODO: decodeBase64url
@dchest
dchest / chrome.md
Last active July 18, 2020 18:20
How to properly use Chrome
  1. Install uBlock Origin extension. (If you're not from US, check its options to turn on ad block lists for your country)

  2. Do not install any other extensions ever! (exceptions: 1Password, Google Arts & Culture).

  3. Create separate "people" for different activities: e.g. home, work, browsing sketchy websites. (Click on avatar > Manage People)

  4. If you want to turn on sync, set up encryption passphrase. It's a separate passphrase from your Google account — your sync data will be encrypted locally with it before hitting Google servers.

  5. Disable saving/auto fill of passwords, payment, and addresses. (https://twitter.com/Sc00bzT/status/1085521985017466881)

@dchest
dchest / 3B-Plus.txt
Last active March 22, 2018 12:22
Raspberry Pi 3B+ and 3B openssl speed (ran just once, likely in different ambient temperature, completely non-scientific)
OpenSSL 1.1.0f 25 May 2017
built on: reproducible build, date unspecified
options:bn(64,32) rc4(char) des(long) aes(partial) blowfish(ptr)
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/lib/ssl\"" -DENGINESDIR="\"/usr/lib/arm-linux-gnueabihf/engines-1.1\""
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
md2 0.00 0.00 0.00 0.00 0.00 0.00
mdc2 0.00 0.00 0.00 0.00 0.00 0.00
md4 8692.17k 34247.02k 107042.56k 230394.14k 347587.38k 357886.63k
md5 24228.71k 74809.73k 155908.93k 211904.17k 238160.55k 239976.45k