Skip to content

Instantly share code, notes, and snippets.

View jon-zawada's full-sized avatar
🐧

Jonathan Zawada jon-zawada

🐧
View GitHub Profile
/\ |‾‾| /‾‾/ /‾/
/\ / \ | |_/ / / /
/ \/ \ | | / ‾‾\
/ \ | |‾\ \ | (_) |
/ __________ \ |__| \__\ \___/ .io
execution: local
output: -
script: script.js
@jon-zawada
jon-zawada / Postgres Core Query
Created April 9, 2020 04:59
This query will give me the three related songs per song genre to display in my related songs component
nimbus=# SELECT * FROM songs JOIN users ON songs.id_user = users.id LIMIT 3;
id | song_name | song_plays | song_comments | song_image_url | song_genre | id_playlist | id_user | id | user_name | user_imageurl | user_location | user_follower_count
----+--------------------------+------------+---------------+--------------------------------------+------------+-------------+---------+---------+-------------------+---------------------------------------------------------------------+--------------------+---------------------
1 | ab voluptatem et | 88405 | 84363 | http://lorempixel.com/640/480/cats | edm | 125840 | 997611 | 997611 | Mrs. Vicente Hand | https://s3.amazonaws.com/uifaces/faces/twitter/brandonburke/128.jpg | Majorburgh | 55671
2 | velit accusantium labore | 85421 | 83485 | http://lorempixel.com/640/480/cats | country
@jon-zawada
jon-zawada / gist:8e011530edcb6d3d043dd7506d4b76f4
Created March 13, 2020 23:46
Here is my GET request for my reservation module, this get request gets all reservations for one specific location(id 1)
(8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
0: {id: 1, checkin_date: "2020-01-01T08:00:00.000Z", checkout_date: "2020-01-24T08:00:00.000Z", adults: 3, children: 2, …}
1: {id: 2, checkin_date: "2020-02-13T08:00:00.000Z", checkout_date: "2020-02-23T08:00:00.000Z", adults: 2, children: 2, …}
2: {id: 3, checkin_date: "2020-03-10T07:00:00.000Z", checkout_date: "2020-03-18T07:00:00.000Z", adults: 2, children: 2, …}
3: {id: 4, checkin_date: "2020-04-06T07:00:00.000Z", checkout_date: "2020-04-26T07:00:00.000Z", adults: 2, children: 2, …}
4: {id: 5, checkin_date: "2020-05-01T07:00:00.000Z", checkout_date: "2020-05-17T07:00:00.000Z", adults: 3, children: 0, …}
5: {id: 6, checkin_date: "2020-06-05T07:00:00.000Z", checkout_date: "2020-06-18T07:00:00.000Z", adults: 2, children: 3, …}
6: {id: 7, checkin_date: "2020-07-10T07:00:00.000Z", checkout_date: "2020-07-15T07:00:00.000Z", adults: 2, children: 2, …}
7: {id: 8, checkin_date: "2020-08-12T07:00:00.000Z", checkout_date: "2020-08-18T07:00:00.000Z", adults: 1, children: 3