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
@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'});
@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");
@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]

{
"presets": [
{
"Name": "Major",
"Value": "1;3;5;6;8;10;12",
"Group": "Common"
},
{
"Name": "Minor",
"Value": "1;3;4;6;8;9;11",