Mastering JQ: Part 1 - by Tyler Adams - CodeFaster
This is the first part of an ongoing series on mastering jq. jq is a valuable tool that every fast coder has in their tool chest. It contains depths of immense power. In part 1, we'll start off with the basics.
Learn yaml in Y Minutes
YAML - "strict superset of JSON"
** No tabs **
x : 1 # 1 is a number, not a boolean
x : "The rain in Spain" # Strings can be quoted but don't have to be!
another_key: Another value goes here.
# Multiple line strings - literal (|) or folded (>) blocks
# collections - 2 space indent (by convention)
set :
a : 1
b : 2
c : 3
# arrays/lists
myarray :
- key : a
val : 1
- key : b
val : 2
- key : c
val : 3
Sereal — a binary data serialization format | by booking.development | Booking.com Engineering | Medium
By: Steffen Müller, Yves Orton, Damian Gryski, Chris Veenboer, Rafaël Garcia-Suarez, Ævar Arnfjörð Bjarmason As with many things in computing, serialization of data structures is a game of…
Types in JSON | Choroba | The Perl Conference in Glasgow - Day 1 - 2018
Join us for the first day of TPCiG, in the cPanel Theatre.
Schedule: https://act.perlconference.org/tpc-2018-glasgow/schedule?day=2018-08-15
Live Chat: On IRC at irc.perl.org #yapc
How should we deal with numbers vs strings in JSON? Perl doesn't care!
Cpanel::JSON::XS::Type to the rescue! I'll explain its motivation, show usage and possible traps, describe the implementation, and discuss related problems in other modules.
How to store your app's entire state in the url
I decided to encode the entire application state as a Base64 encoded string in the hashmark of the url. For example, a url would look like (note its truncated since they are very long):
Here's the pseudo code for creating the url, and then later reading it:
const stateString = JSON.stringify(appState); // appState is a json object
const compressed = compress(stateString);
const encoded = Base64.encode(compressed);
// Push that `encoded` string to the url
// ... Later, on page load or on undo/redo we read the url and
// do the following
const decoded = Base64.decode(encoded); // same encoded as above, but read from url
const uncompressed = uncompress(decoded);
const newState = JSON.parse(uncompressed);
// Now load your application with the newState
A better idea is to use the URI fragment (the string after the # sign). It has the advantage of not having a size limit, and not needing to be sent all to the backend during the request. window.location.hash
is your friend.
GitHub - tomnomnom/gron: Make JSON greppable!
Make JSON greppable! Contribute to tomnomnom/gron development by creating an account on GitHub.
gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute 'path' to it. It eases the exploration of APIs that return large blobs of JSON but have terrible documentation.