Skip to content

Instantly share code, notes, and snippets.

View davay42's full-sized avatar
✌️
Open source development for amazing future ✨

davay davay42

✌️
Open source development for amazing future ✨
View GitHub Profile
{
"presets": [
{
"Name": "Major",
"Value": "1;3;5;6;8;10;12",
"Group": "Common"
},
{
"Name": "Minor",
"Value": "1;3;4;6;8;9;11",
@davay42
davay42 / README.md
Created September 3, 2018 19:51 — forked from christophermanning/README.mkd
Hamiltonian Graph Builder
<style type="text/css">p {text-align:center;width: auto}</style>

Created by Christopher Manning

Gallery

Axle Eight Fibbobaci Florets [![Star]

@taylor8294
taylor8294 / Matter.RenderSVG.js
Last active May 26, 2024 05:08
The `RenderSVG` module is an SVG alternative to the Matter.js built-in canvas-based renderer.
/**
* Overwrite `Common.isElement` to allow for SVG elements also
*/
Matter.Common.isElement = function(obj) {
try {
return obj instanceof HTMLElement || obj instanceof SVGElement;
} catch (e) {
return (typeof obj === "object") &&
(obj.nodeType === 1) && (typeof obj.style === "object") &&
(typeof obj.ownerDocument === "object");
@Dletta
Dletta / sendBlobJson.js
Created July 11, 2019 17:29
sending JSON objects via Blobs
var obj = {name:"test", result:"hello world"};
var string = JSON.stringify(obj);
console.log(obj)
var arr = [];
encode = Array.from(string);
while(encode.length>0){
arr.push(encode.shift().charCodeAt(0));
}
var u16 = new Uint16Array(arr);
var blob = new Blob([u16], {type:'application/json'});
@Dletta
Dletta / index.html
Created September 7, 2019 03:37
Gun in Service Worker
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Concept Chat</title>
<link rel="stylesheet" href="index.css" >
</head>
<body>
@jessuni
jessuni / GenerateAudioWaveform
Last active July 3, 2023 05:58
Audio Oscilloscope (Frequency Byte) - w/ web audio API and canvas
// rename gist
@jabis
jabis / Sending and reading Messages with gun.js
Last active June 14, 2022 08:56
Send and receive messages with gun
/*so let's simplify you have
- your letters (all messages, yours & other peer) which you draw to DOM
- you have your outbox , when you say something, that the other person listens to with .on(...)
and adds to their letters when they arrive
- you listen with .on(...) the other peers messages and add them to letters when
they arrive
- on your send(){...} you would add the message to your letters
and to the outbox so your message can trigger the other persons .on */
class Chat {
@jabis
jabis / gun.helper.js
Last active July 15, 2023 10:48
Gun user-space and public graph get/set with signing and encryption
/**
* get and put encrypted and/or signed material to paths in Gun
* FIXME: Investigate why root level put doesn't work
*
* DONE: Add signing to make objects unwritable by others
* Changes:
* - 25.02.2020
* - added mergedeep to better merge deeper objects between themselves
* - added pair.osign option to only sign not encrypt when passing existing pairs
**/
@tomhicks
tomhicks / plink-plonk.js
Last active December 26, 2025 08:35
Listen to your web pages
@Kaiido
Kaiido / drawImage-clipper.js
Created January 31, 2021 03:21
Safari drawImage out-of-bounds fixer
/**
* MIT License - Copyright (c) 2021 Kaiido
*
* A monkey-patch for Safari's drawImage.
*
* This browser doesn't handle well using the cropping abilities of drawImage
* with out-of-bounds values.
* (see https://stackoverflow.com/questions/35500999/cropping-with-drawimage-not-working-in-safari)
* This script takes care of detecting when the monkey-patch is needed,
* and does redefine the cropping parameters so they fall inside the source's boundaries.