Skip to content

Instantly share code, notes, and snippets.

View w8r's full-sized avatar
💭
learning

Alexander Milevski w8r

💭
learning
View GitHub Profile
@w8r
w8r / wheel_to_pinch.ts
Last active June 18, 2024 17:22
Wheel to pinch
function startGesture(gesture) {
console.log("start", gesture);
}
function doGesture(gesture) {
console.log("do", gesture);
}
function endGesture(g) {
console.log("end", gesture);
}
@w8r
w8r / link.txt
Created March 27, 2024 16:13
Marketing dataset
@w8r
w8r / readPixelsAsync.ts
Created January 25, 2024 12:35
readPixelsAsync.ts
const clientWaitAsync = function (gl, sync, flags = 0, interval_ms = 10) {
return new Promise<void>(function (resolve, reject) {
const check = () => {
const res = gl.clientWaitSync(sync, flags, 0);
if (res === gl.WAIT_FAILED) {
reject();
return;
}
if (res === gl.TIMEOUT_EXPIRED) {
setTimeout(check, interval_ms);

Whose life do I admire that is secretly miserable?

What do I believe is true only because believing it puts me in good standing with my tribe?

Which of my current values would be different if I were raised by different parents?

What do I believe the most with the least amount of evidence of it being true?

Who has the right answer but I ignore because they’re a bad communicator?

@w8r
w8r / AI-en.md
Last active September 7, 2022 23:17
AI screenplays hackathon

Problem

We wanted to find out if we can generate movie screenplays or short story synopsises using artificial intelligence. The idea was to see if we can train it not only to follow the certain text style, but make it produce new ideas and deliver them in a structured way.

State of the art

We have explored the artificial intelligence models for text generation. We have focused on the latest most recent and advanced models capable of producing and imitating natural language. The latest models are GPT-3 by OpenAI and GPT-J by EleutherAI. They are very heavy and complex models trained to predict and continue text based on their language model and the provided context. Both have billions of internal parameters and are able to produce about 500-1000 words based on the context that is passed in as a prompt or question, few parameters and the adjustments made by feeding them different datasets before using them. Both are based on the same scientific research but trained by different companies on different gig

@w8r
w8r / graphToSVG.ts
Last active March 10, 2024 15:08
Graph to SVG
type Id = string | number;
interface Node {
id: Id;
color: string;
radius: number;
x: number;
y: number;
strokeWidth?: number;
strokeColor?: string;
@w8r
w8r / linked_list.ts
Created January 19, 2022 12:29
Simple doubly-linked list
export class Node<T>{
data: T;
prev: Node<T> = null;
next: Node<T> = null;
constructor(data: T) {
this.data = data;
}
}
@w8r
w8r / index.js
Created December 3, 2021 10:11
Is.gd url shortening
const url = `https://maps.google.com`;
fetch(`https://is.gd/create.php?format=simple&url=${url}`)
.then(r => r.text())
.then(r => console.log(r));
@w8r
w8r / array-intersection.ts
Created July 31, 2021 19:47
Array intersection
function intersection(...lists) {
const result = [];
const resultLUT = {};
for(let i = 0; i < lists.length; i ) {
const currentList = lists[i];
for(let y = 0; y < currentList.length; y ) {
const currentValue = currentList[y];
if(!resultLUT[currentValue]) {
let existsInAll = true;
@w8r
w8r / createDataContext.tsx
Created November 20, 2020 22:01
Create data context
import React, { useReducer, Reducer, createContext, ReactNode, Dispatch } from "react";
type Action = <A>(dispatch: Dispatch<A>) => Function;
export default function <S, A extends Action>(
reducer: Reducer<S, A>,
actions: Record<string, A>,
initialState: S
) {
const Context = createContext<S>({} as S);