Skip to content

Instantly share code, notes, and snippets.

@Robitx
Robitx / LLM.md
Created March 30, 2023 08:48 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@Robitx
Robitx / latency.txt
Created November 1, 2022 22:23 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@Robitx
Robitx / gym.py
Created September 29, 2021 06:08 — forked from Alir3z4/gym.py
import os
import pickle
import warnings
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Dropout
@Robitx
Robitx / svelte.md
Created August 9, 2021 19:25 — forked from peltho/svelte.md
Svelte cheatsheet
@Robitx
Robitx / gist:99b8be6c218a462b6f9de0df1db41661
Created August 8, 2021 20:07 — forked from dcneiner/gist:1137601
List of Inherited CSS
Consolidated lists of CSS properties that are inherited by default.
Taken from http://www.w3.org/TR/CSS21/propidx.html
--------------------------------------------------------------------
One item not in the list was "text-decoration" which affects child elements. A few new properties (text-shadow) also affect child elements
List
azimuth
border-collapse
// ES2017 Asynchronous Export
// module.js
export default new Promise(async $export => {
const module = await Promise.resolve(
{my: 'module'}
);
$export(module);
});
// - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@Robitx
Robitx / proxy.js
Created August 8, 2021 19:56 — forked from WebReflection/proxy.js
A proxy with a handler.proxy always available.
const proxy = (target, handler) => {
handler = typeof handler === 'object' ?
Object.create(handler) : new handler;
return (handler.proxy = new Proxy(target, handler));
};
@Robitx
Robitx / i18n.js
Created August 8, 2021 19:55 — forked from WebReflection/i18n.js
i18n in 10 lines of code
function i18n(template) {
for (var
info = i18n.db[i18n.locale][template.join('\x01')],
out = [info.t[0]],
i = 1, length = info.t.length; i < length; i++
) out[i] = arguments[1 + info.v[i - 1]] + info.t[i];
return out.join('');
}
i18n.locale = 'en';
i18n.db = {};
@Robitx
Robitx / handle-event-doodle.md
Created August 8, 2021 19:14 — forked from WebReflection/handle-event-doodle.md
The `handleEvent` ASCII doodle

About This Gist

This gist summarizes the handleEvent(event) pattern features, something standard, something described by me many times, written in my tiny book, tweeted about, and yet it's something most Web developers ignore.

The handleEvent ASCII Doodle

                  ┌---------------------------------┐
var handler = {   | any object that inherits or     |

async / return await explained

This is yet another explanation of why async and return await is pointless, coming from this post.

// async means that this:
const fn = async (...args) => {/* stuff */};

// is basically the equivalent of this: