Skip to content

Instantly share code, notes, and snippets.

View edzis's full-sized avatar

Edgar Simson edzis

View GitHub Profile
@edzis
edzis / BlobImage.tsx
Created February 16, 2022 16:03
Image component that uses Blob URLs acquired via React Query with createObjectURL and cleanup with revokeObjectURL.
import React from 'react';
import { Query, useQuery } from 'react-query';
const QUERY_KEY_BASE = 'BlobImage';
const BLOB_URL_CACHE_TIME = 5000;
const DEBUG = process.env.NODE_ENV === 'development' && true;
type ImageProps = React.ImgHTMLAttributes<HTMLImageElement>;
const useBlobImageUrl = (src: ImageProps['src']) => {
@edzis
edzis / index.1.js
Created May 21, 2020 07:08
Test for https://github.com/BabylonJS/Babylon.js/pull/8163, to be placed in localDev/src/
var createScene = function () {
// Create basic scene
var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);
camera.setTarget(BABYLON.Vector3.Zero());
camera.attachControl(canvas, true);
var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
light.intensity = 0.7;
var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
sphere.rotation.z = Math.PI/2

Keybase proof

I hereby claim:

  • I am edzis on github.
  • I am edgarsimson (https://keybase.io/edgarsimson) on keybase.
  • I have a public key whose fingerprint is 138B 3180 7D80 705C BE0B A340 F575 7174 EEA7 DC5B

To claim this, I am signing this object: