Skip to content

Instantly share code, notes, and snippets.

View harunsmrkovic's full-sized avatar
:electron:
decoding

Harun Smrkovic harunsmrkovic

:electron:
decoding
View GitHub Profile
@harunsmrkovic
harunsmrkovic / machine.js
Last active July 29, 2021 17:07
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@harunsmrkovic
harunsmrkovic / machine.js
Last active May 21, 2021 14:32
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@harunsmrkovic
harunsmrkovic / hide-snapshots-in-diff.js
Created June 27, 2018 16:19
Hide all snapshot diffs in GitHub PR
(function() {
const FILES_TO_HIDE = 'snapshots'
if (window.location.href.includes('/pull/') && window.location.href.includes('/files')) {
Array.from(document.querySelectorAll('.file-header'))
.filter(node => node.querySelector('.file-info > a').outerText.includes(FILES_TO_HIDE))
.forEach(node => node.parentNode.querySelector('.file-actions .js-details-target').click())
}
})()
@harunsmrkovic
harunsmrkovic / Rectangle.test.js
Created November 26, 2017 11:17
Fingerprint methods of an object
import React from 'react'
import { shallow } from 'enzyme'
import { RectangleBase as Rectangle } from '.'
const defaultProps = {
width: 10,
height: 10,
x: 1,
y: 1
@harunsmrkovic
harunsmrkovic / pik.js
Created November 24, 2017 18:33
pik poslana poruka
$.get('/poruke/outbox', data => {
const html = $.parseHTML(data)
const poruke = $(
html.filter(el => el.className && el.className.includes('container-poruke'))
)
.find('.jedna_konverzacija')
.map((i, poruka) => ({
autor: $.trim(
$(poruka)
.find('.user')