Skip to content

Instantly share code, notes, and snippets.

@virzen
virzen / drag_and_drop_helper.js
Last active January 19, 2021 13:41 — forked from rcorreia/drag_and_drop_helper.js
Drag and drop helper with separate drag, drop and drag end simulation for cases when drop targets show up only after dragging.
(function () {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)
@virzen
virzen / machine.js
Last active March 16, 2020 13:11
Generated by XState Viz: https://xstate.js.org/viz
// MOCKS
const randInt = () => Math.trunc(Math.random() * 100);
const products = Array(60)
.fill(null)
.map(_ => ({ value1: randInt(), value2: randInt() }));
function fetchProducts(pagination, sort) {
const { page, perPage } = pagination;

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@virzen
virzen / Hi.jpg
Last active December 9, 2019 12:28 — forked from ryanlucas/Hi.jpg
Image Prototype Demo&
Hi.jpg
Map
Loading markers
Showing markers
@virzen
virzen / SketchSystems.spec
Last active September 4, 2019 12:52
Fetching missing agent
Fetching missing agent
Is agent in the list?
yes? -> Agent in the list
no? -> Agent not in the list
Agent in the list
more info clicked -> Agent selected
Agent not in the list
more info clicked -> Agent loading
Agent selected
Agent loading
@virzen
virzen / SketchSystems.spec
Last active December 9, 2019 13:32
Migration patterns&
Migration patterns&
Direction
Sent
direction changed ? received -> Received
Received
direction changed ? sent -> Sent
Drawer
Open
@virzen
virzen / SketchSystems.spec
Last active September 5, 2019 19:26
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
go to test -> Test
Test
Stuff
Rotfl
XD
Lol
@virzen
virzen / SketchSystems.spec
Last active September 5, 2019 19:26
My Awesome Sketch
My Awesome Sketch
First State
some event -> Second State
Second State
@virzen
virzen / machine.js
Created August 29, 2019 09:02
Generated by XState Viz: https://xstate.js.org/viz
const userMachine = Machine({
id: 'user',
initial: 'idle',
context: {
userId: 42,
user: undefined,
error: undefined
},
states: {
idle: {