Skip to content

Instantly share code, notes, and snippets.

View dmnsgn's full-sized avatar

Damien Seguin dmnsgn

View GitHub Profile
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active April 24, 2024 18:36
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@dmnsgn
dmnsgn / listAllEventListeners.js
Created April 5, 2017 15:40
List all event listeners in a document
const listeners = (function listAllEventListeners() {
let elements = [];
const allElements = document.querySelectorAll('*');
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
for (let i = 0; i < allElements.length; i++) {
const currentElement = allElements[i];
@dmnsgn
dmnsgn / JavaScript landscape: compilers, bundlers and others by the numbers.md
Last active October 31, 2023 22:28
A non-exhaustive list of tools for JavaScript development as it has become "complicated".

JavaScript landscape: compilers, bundlers and others by the numbers

A non-exhaustive list of tools for JavaScript development as it has become "complicated".

Compilers

Name: language Stars Last Commit Owner/Sponsorship
tsc: JavaScript GitHub Repo stars GitHub last commit Microsoft
[babel]
@dmnsgn
dmnsgn / SingletonModuleScopedInstance.js
Created April 16, 2016 17:41
ES6 singleton pattern: constructor return an instance scoped to the module
// http://amanvirk.me/singleton-classes-in-es6/
let instance = null;
class SingletonModuleScopedInstance {
constructor() {
if (!instance) {
instance = this;
}
this._type = 'SingletonModuleScopedInstance';
@dmnsgn
dmnsgn / SingletonDefaultExportInstance.js
Last active February 9, 2023 16:54
ES6 singleton pattern: module default exports an instance
class SingletonDefaultExportInstance {
constructor() {
this._type = 'SingletonDefaultExportInstance';
}
singletonMethod() {
return 'singletonMethod';
}
static staticMethod() {
// Author: Abhishek Dutta, 12 June 2020
// License: CC0 (https://creativecommons.org/choose/zero/)
export default function uuid() {
var temp_url = URL.createObjectURL(new Blob());
var uuid = temp_url.toString();
URL.revokeObjectURL(temp_url);
return uuid.substr(uuid.lastIndexOf('/') + 1); // remove prefix (e.g. blob:null/, blob:www.test.com/, ...)
}
console.log("foo");
I am attesting that this GitHub handle dmnsgn is linked to the Tezos account tz2AmQarWLeMoQVt2h9a4QYywTUtg8bH5t5B for tzprofiles
sig:spsig1enZE4k2VP8aj8J6kJLQLLXrRVUXmT8R2CTDdKqYqKUdNH4rNxu1DwTcpdvdToMEnYnr5PgZuVohjZFnJiCCcLDz9Jkqnz
@dmnsgn
dmnsgn / .eslintrc.js
Created July 23, 2015 13:31
.eslintrc Google JavaScript Style Guide (eslint v0.24.1)
{
// http://eslint.org/docs/rules/
"env": {
"browser": true, // browser global variables.
"node": false, // Node.js global variables and Node.js-specific rules.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
@dmnsgn
dmnsgn / SingletonEnforcer.js
Created April 16, 2016 17:43
ES6 singleton pattern: use Symbol to ensure singularity
// http://stackoverflow.com/a/26227662/1527470
const singleton = Symbol();
const singletonEnforcer = Symbol();
class SingletonEnforcer {
constructor(enforcer) {
if (enforcer !== singletonEnforcer) {
throw new Error('Cannot construct singleton');
}