Skip to content

Instantly share code, notes, and snippets.


Simone Potenza rewop

  • HousingAnywhere
  • Rotterdam
  • @r3wop
View GitHub Profile
rewop /
Last active Nov 19, 2020
Go json diff

This is a simple piece of code that I used to show a friend how I would compare two json object in Go. It exposes a function to compare two JSON given as []byte.

The code assumes that the json object are small enough to be loaded in memory.


This gist shows why we should avoid register to the window load event inside a promise chain. I encountered this bug at work, and this is the demostration of how to reproduce it.

Notice how the console.log at line 19 of script.js is never called, and the console never prints Do something on load.

rewop /
Last active Aug 5, 2018 — forked from dseelmann/.eslintrc
Test task


Implement a page with a multi-step form, where each step shows when you have completed the previous one. In other words, we're not looking for previous/next buttons, but the next step should appear automatically.


  1. Two checkboxes with labels A1 and A2. Both are unchecked by default. Next step is available after at least one of them is checked.
  2. Two toggle buttons with labels B1 and B2. One button untoggles another (same as radio buttons behavior). Both are inactive by default. Next step is available when any option has been chosen.
  3. Text field with button Check. When button is pressed a value of the field will be send. Next step is available if a response from API is fine.
  4. Selectbox with C1, C2, C3 options. It is empty by default. Next step is available when any option has been chosen.
View handleScroll.js
const handleScroll = _history => {
_history.listen(location => {
// Use setTimeout to make sure this runs after React Router's own listener
setTimeout(() => {
// Keep default behavior of restoring scroll position when user:
// - clicked back button
// - clicked on a link that programmatically calls `history.goBack()`
rewop / rewop.zsh-theme
Created Oct 11, 2014
My favourite zsh theme
View rewop.zsh-theme
# the idea of this theme is to contain a lot of info in a small string, by
# compressing some parts and colorcoding, which bring useful visual cues,
# while limiting the amount of colors and such to keep it easy on the eyes.
# When a command exited >0, the timestamp will be in red and the exit code
# will be on the right edge.
# The exit code visual cues will only display once.
# (i.e. they will be reset, even if you hit enter a few times on empty command prompts)
typeset -A host_repr
View gist:6111900
# A pre-commit hook for git to lint JavaScript files with jshint
# @see
if git rev-parse --verify HEAD >/dev/null 2>&1
# Initial commit: diff against an empty tree object
You can’t perform that action at this time.