Skip to content

Instantly share code, notes, and snippets.

View gist:30fd885210d6c7e819789380e8d657fd
TOX
ALPRAZOLAM (XANAX)
PREGABALIN (LYRICA)
BUPRENORPHINE (SUBOXONE)
NALOXONE (SUBOXONE)
TAPENTADOL (NUCYNTA)
GABAPENTIN (GRALISE)
AMPHETAMINE (ADDERALL/VYVANSE)
CLONAZEPAM (KLONOPIN)
AMBIEN (ZOLPIDEM)
@ryanrussell
ryanrussell / gist:6e11083b10d551e1b52ed46f04163fb0
Created Feb 7, 2018
3rd party api call, data transform, html render via js
View gist:6e11083b10d551e1b52ed46f04163fb0
e = 0;
r = "https://api.trustpilot.com/v1/business-units/51f8360b00006400056d09a4/reviews?apikey=D1SVsfCby6RRoLghNO9RqeOvJckC5zyy&stars=5&page=1&perPage=15";
console.log(r);
$.getJSON(r, function(n) {
$.each(n.reviews, function(n, t) {
var e = new Date(t.createdAt),
o = new Date,
s = "",
r, u, h, c, f, i;
f = o - e;
View TP API RESPONSE
{"links":[{"href":"https://api.trustpilot.com/v1/business-units/51f8360b00006400056d09a4","method":"GET","rel":"business-units"},{"href":"https://api.trustpilot.com/v1/business-units/51f8360b00006400056d09a4/reviews?stars=5&page=2&perPage=15&orderBy=createdat.desc&includeReportedReviews=false","method":"GET","rel":"next-page"}],"reviews":[{"links":[{"href":"https://api.trustpilot.com/v1/reviews/5a7b42e26116dd0b184e0d4f","method":"GET","rel":"reviews"},{"href":"https://api.trustpilot.com/v1/reviews/5a7b42e26116dd0b184e0d4f/web-links","method":"GET","rel":"reviews-web-links"},{"href":"https://api.trustpilot.com/v1/resources/images/stars/5","method":"GET","rel":"resources-images-stars"}],"id":"5a7b42e26116dd0b184e0d4f","consumer":{"links":[{"href":"https://api.trustpilot.com/v1/consumers/5a7b42e264c8174c8cf41581","method":"GET","rel":"consumers"}],"id":"5a7b42e264c8174c8cf41581","displayName":"Shawshay Dorsey","displayLocation":null,"numberOfReviews":1},"businessUnit":{"links":[{"href":"https://api.trustpilot.co
View http1-http2
Test results:
Desktop HTTP2(preprod:443)
[2018-02-08 21:32:13] INFO: 70 requests, 384.54 kb, backEndTime: 508ms (±64.70ms), firstPaint: 857ms (±83.27ms), firstVisualChange: 945ms (±114.16ms), DOMContentLoaded: 961ms (±69.13ms), Load: 1.72s (±13.82ms), speedIndex: 993 (±107.02), visualComplete85: 1.11s (±90.64ms), lastVisualChange: 1.11s (±90.64ms), rumSpeedIndex: 938 (±71.92) (3 runs)
Desktop HTTP(preprod:80)
[2018-02-08 21:33:54] INFO: 73 requests, 378.24 kb, backEndTime: 309ms (±42.37ms), firstPaint: 636ms (±46.62ms), firstVisualChange: 689ms (±51.47ms), DOMContentLoaded: 731ms (±41.61ms), Load: 1.36s (±46.76ms), speedIndex: 779 (±41.09), visualComplete85: 967ms (±35.88ms), lastVisualChange: 967ms (±35.88ms), rumSpeedIndex: 768 (±43.60) (3 runs)
3g HTTP2
[2018-02-08 21:35:22] INFO: 26 requests, 289.21 kb, backEndTime: 1.19s (±80.07ms), firstPaint: 1.82s (±151.58ms), firstVisualChange: 1.85s (±145.47ms), DOMContentLoaded: 2.30s (±86.75ms), Load: 4.21s (±98.65ms), speedIndex: 2103 (±139.13), visualComplete
View gulp - citysdk fail
ryan@desktop:~/workspace/citysdk$ node -v
v9.5.0
ryan@desktop:~/workspace/citysdk$ gulp -v
[17:52:03] CLI version 3.9.1
[17:52:03] Local version 3.9.1
ryan@desktop:~/workspace/citysdk$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04