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 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
.
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.
A1
and A2
. Both are unchecked by default. Next step is available after at least one of them is checked.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.Check
. When button is pressed a value of the field will be send. Next step is available if a response from API is fine.C1
, C2
, C3
options. It is empty by default. Next step is available when any option has been chosen.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()` |
# 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 |
#!/bin/sh | |
# A pre-commit hook for git to lint JavaScript files with jshint | |
# @see https://github.com/jshint/jshint/ | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 |