Skip to content

Instantly share code, notes, and snippets.

@anuragvohraec
anuragvohraec / .Service Worker Setup.md
Created December 11, 2020 22:28 — forked from bryandh/.Service Worker Setup.md
Service Worker setup in Typescript

Service Worker Setup

@anuragvohraec
anuragvohraec / create-a-file-and-upload-as-attachment-to-couchdb.js
Created January 4, 2021 03:34 — forked from rjcorwin/create-a-file-and-upload-as-attachment-to-couchdb.js
With Javascript, create a new file and send it to a CouchDB database as an attachment to a document
// With Javascript, create a new file and send it to a CouchDB database as an attachment of a Document
// Code inspired by "NEW TRICKS IN XMLHTTPREQUEST2" by Eric Bidelman
// http://www.html5rocks.com/en/tutorials/file/xhr2/
/*
* There are two ways of accomplishing this. The first way will always result in a filename of "blob", which is
* bummer. The second way you will be able to name the file what you want. Note that these examples
* assume you have the ID of the database, the ID of the Document, and the most recent revision hash of that Document.
*/
@anuragvohraec
anuragvohraec / pearson-hashing.js
Created July 15, 2021 14:32 — forked from thejsj/pearson-hashing.js
Pearson Hashing Function
'use strict'
// Ideally, this table would be shuffled...
// 256 will be the highest value provided by this hashing function
let table = [...new Array(256)].map((_, i) => i)
const hash8 = (message, table) => {
return message.split('').reduce((hash, c) => {
return table[(hash + c.charCodeAt(0)) % (table.length - 1)]
}, message.length % (table.length - 1))
{
Dynamic Linker Bug
Memcheck:Cond
fun:_dl_relocate_object
fun:dl_main
fun:_dl_sysdep_start
fun:_dl_start
obj:/lib/ld-2.6.so
}
{
@anuragvohraec
anuragvohraec / read.md
Created April 1, 2024 11:21
Enable WebGPU on Chrome on linux
  1. Open chrome://flags/ in chrome
  2. Enable all this options image