Skip to content

Instantly share code, notes, and snippets.

View humoyun91's full-sized avatar
🦅
Always eager

humoyun humoyun91

🦅
Always eager
View GitHub Profile

Online Photo Editing - FabricJS Masking

A while ago I tried implementing a photo mask tool in MockoFun which is based on FabricJS

Check out an working example: https://jsfiddle.net/codingdude/sk84xLh2/

The solution I came up was combining the built in fabric.Image.filters.BlendImage filter with a custom FabricJS brush. Here's a glimpse at my implementation of that.

(function(){
@humoyun91
humoyun91 / Infrastructure.js
Created November 9, 2021 08:04 — forked from sebmarkbage/Infrastructure.js
SynchronousAsync.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
#!/bin/bash
echo "###################################################"
echo "########## Xcode Command-Line Tools ###############"
echo "###################################################"
xcode-select --install
echo "###################################################"
echo "############ Installing Homebrew ##################"
echo "###################################################"
@humoyun91
humoyun91 / lru-cache.tsx
Created August 6, 2021 05:24
TypeScript implementation of lru cache
// The problem can be solved with a HashTable that keeps track of the keys and its values in the double linked list.
// One interesting property about Double Linked List is that the node can remove itself without other reference.
// In addition, it takes constant time to add and remove nodes from the head or tail.
// we need to restrict key types as it is not possible
// to support any type of keys in Association data
/**
* draw io
* https://app.diagrams.net/#G1CGQ2rrhcgyjLS9ZYQSHXLsxfqn7vH402
@humoyun91
humoyun91 / keybase.md
Last active June 22, 2021 01:59
keybase.md

Keybase proof

I hereby claim:

  • I am humoyun91 on github.
  • I am humoyun91 (https://keybase.io/humoyun91) on keybase.
  • I have a public key ASC6qswyz1mpXT5ODtngr8FRnOWP5mpKCyH9ntF4WKghSAo

To claim this, I am signing this object: