Skip to content

Instantly share code, notes, and snippets.

@jbinkleyj
jbinkleyj / canvas-fit-to-container-p5.js
Created September 17, 2023 21:00 — forked from fffiloni/canvas-fit-to-container-p5.js
Create canvas with container's dimension in p5js
// HTML index.html
// <div id="myCanvasContainer"></div>
// JS sketch.js
// Inside setup() function
let canvasDiv = document.getElementById('myCanvasContainer');
let width = canvasDiv.offsetWidth;
let height = canvasDiv.offsetHeight;
let sketchCanvas = createCanvas(width,height);
@jbinkleyj
jbinkleyj / code-assist.md
Created June 10, 2023 15:25 — forked from Birch-san/code-assist.md
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

Ml Related Resource

  1. https://github.com/trekhleb/homemade-machine-learning There are two folders homemade and notebook, homemade contains all well commented low level code and doc explaining maths. Notebook is like a more of API use.
  2. https://github.com/Avik-Jain/100-Days-Of-ML-Code It contains more pictorial explanation with just API usage, worth seeing, might come in handy to revise quickly
  3. https://github.com/rushter/MLAlgorithms This contains fundamental implementation of bit more advanced algorithms.

How I found all of these repo

  1. https://github.com/topics/machine-learning-algorithms I went there and scrolled, you can do that too
@jbinkleyj
jbinkleyj / 2019-https-localhost.md
Created October 14, 2021 17:08 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@jbinkleyj
jbinkleyj / cubemap.bat
Created October 14, 2021 17:07 — forked from cecilemuller/cubemap.bat
Generate a DDS cubemap from 6 JPEG images
texassemble cube -w 1024 -h 1024 -o cubemap.dds px.jpg nx.jpg py.jpg ny.jpg pz.jpg nz.jpg
texconv cubemap.dds -m 0 -y -f BC1_UNORM
@jbinkleyj
jbinkleyj / main.ts
Created October 14, 2021 17:07 — forked from cecilemuller/main.ts
Typescript Webworker
/* eslint-env browser */
import type {IRequestWorker} from "./worker.ts";
const worker = new Worker(new URL("./worker.ts", import.meta.url)) as IRequestWorker;
// Receive from the worker
worker.onmessage = ({data: {myresponse}}) => {
console.log(myresponse);
};
@jbinkleyj
jbinkleyj / cult_of_ignorance.md
Created October 14, 2021 17:01 — forked from jaeh/cult_of_ignorance.md
A Cult Of Ignorance, Isaac Asimov

It's hard to quarrel with that ancient justification of the free press: "America's right to know." It seems almost cruel to ask, ingenously, "America's right to know what, please? Science? Mathematics? Economics? Foreign languages?"

None of those things, of course. In fact, one might well suppose that the popular feeling is that Americans are a lot better off without any of that tripe.

There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way through out political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."

Politicians have routinely striven to speak the language of Shakespeare and Milton as ungrammaticaly as possible in order to avoid offending their audiences by appearing to have gone to school. Thus, Adlai Stevenson, who incautiously allowed intelligence and learning and wit to peep out of his speeches, found the American people

@jbinkleyj
jbinkleyj / 10_codes.md
Created July 18, 2021 23:41 — forked from navicore/10_codes.md
10 code speak
10-0 Use Caution
10-1 Signal Weak
10-2 Signal Good
10-3 Stop Transmitting
10-4 Message Received
10-5 Relay
10-6 Station is busy
10-7 Out Of Service
10-8 In Service
@jbinkleyj
jbinkleyj / multi_object_tracking.py
Created April 25, 2020 14:08 — forked from adioshun/multi_object_tracking.py
Tracking multiple objects with OpenCV
# https://www.pyimagesearch.com/2018/08/06/tracking-multiple-objects-with-opencv/
# USAGE
# python multi_object_tracking.py --video videos/soccer_01.mp4 --tracker csrt
# import the necessary packages
from imutils.video import VideoStream
import argparse
import imutils
import time