start new:
tmux
start new with session name:
tmux new -s myname
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json) | |
RETURNS json | |
IMMUTABLE | |
LANGUAGE sql | |
AS $$ | |
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json | |
FROM ( | |
SELECT * FROM json_each(data) | |
UNION ALL | |
SELECT * FROM json_each(insert_data) |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
getWikipediaData(query){ | |
var dbpediaHeaders = new Headers(); | |
//add json response type for dbpedia query | |
dbpediaHeaders.append("accept", "application/json"); | |
//if the query has multiple words separated by the comma, take the first word, otherwise just use the query | |
query=query.indexOf(",")>0?query.split(',')[0]:query; | |
//if we know the query is a country, only look for countries |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.