Skip to content

Instantly share code, notes, and snippets.

Created September 29, 2016 15:12
Show Gist options
  • Save anonymous/98183eb0c498deac4fac2caf637cc3d1 to your computer and use it in GitHub Desktop.
Save anonymous/98183eb0c498deac4fac2caf637cc3d1 to your computer and use it in GitHub Desktop.
Welcome to JS Bin // source http://jsbin.com/hidehuk
<script src="https://cdn.rawgit.com/zloirock/core-js/master/client/shim.min.js"></script>
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.com/coffee-script/extras/coffee-script.js"></script>
<meta charset=utf-8 />
<title>Welcome to JS Bin</title>
<meta name="viewport" content="width=device-width">
<link href='http://fonts.googleapis.com/css?family=Doppio+One' rel='stylesheet' type='text/css'>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</head>
<body>
<script id="jsbin-javascript">
var users = [ { userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5548bf7df73c542a5593d9ed',
name: 'Harry Rose',
email: 'hrose@senseye.io' } ];
var insights = [ { id: '700f3870-4802-4328-b0ba-9a764add0e92',
type: 'comment',
comment: 'more test feedback',
insight: '165ea754-511c-4aaf-8d0e-29486e54b1a1',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:47:04.068Z',
href: '/v1/feedback/insight/700f3870-4802-4328-b0ba-9a764add0e92' },
{ id: '87685cb2-5de2-4e54-926a-066c6663e6cd',
type: 'comment',
comment: 'Testing feedback',
insight: '26ea6aa6-cf84-4128-925c-1c4aaa01066c',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:34:05.281Z',
href: '/v1/feedback/insight/87685cb2-5de2-4e54-926a-066c6663e6cd' },
{ id: 'e1384865-5641-4229-9559-a508ece68d33',
type: 'comment',
comment: 'ever more testing',
insight: '2c22c59a-bf31-4786-abbe-0e7c9097200e',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:52:44.482Z',
href: '/v1/feedback/insight/e1384865-5641-4229-9559-a508ece68d33' },
{ id: '372992ef-9321-4569-8d5d-2eb956052677',
type: 'comment',
comment: 'TC: this is feedback prior to deploying the change to add security to the alert service',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T08:25:05.425Z',
href: '/v1/feedback/insight/372992ef-9321-4569-8d5d-2eb956052677' },
{ id: 'c7b58f71-940f-43ef-94d1-0e01c7545e1f',
type: 'comment',
comment: 'TC post feedback service deploy',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T10:26:24.425Z',
href: '/v1/feedback/insight/c7b58f71-940f-43ef-94d1-0e01c7545e1f' },
{ id: '014954d1-327e-48ee-ad0e-8821600f4ee2',
type: 'positive',
comment: 'testing again',
insight: '5d39aada-f9a2-4c20-a7ab-7707f29058fe',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-20T10:06:56.954Z',
href: '/v1/feedback/insight/014954d1-327e-48ee-ad0e-8821600f4ee2' },
{ id: 'a819210f-da59-4959-b820-864fb6704c17',
type: 'positive',
comment: 'Amazing',
insight: 'a0dedda1-40c7-49a9-a131-fec7bda33d99',
user: 'auth0|5548bf7df73c542a5593d9ed',
created: '2016-06-02T11:01:58.775Z',
href: '/v1/feedback/insight/a819210f-da59-4959-b820-864fb6704c17' },
{ id: '70303d4e-5c4b-4743-9fe6-c475e24a997d',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:34:03.766Z',
href: '/v1/feedback/insight/70303d4e-5c4b-4743-9fe6-c475e24a997d' },
{ id: '9bdf4168-91ff-491a-b0e0-27a3d33e42f5',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:33:49.059Z',
href: '/v1/feedback/insight/9bdf4168-91ff-491a-b0e0-27a3d33e42f5' },
{ id: '15a0c4af-6f2c-4459-b78c-47a8ff569839',
type: 'positive',
comment: 'good stuff',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-19T18:38:22.556Z',
href: '/v1/feedback/insight/15a0c4af-6f2c-4459-b78c-47a8ff569839' } ];
res = insights.map(x => Object.assign(x, users.find(y => y.userid == x.user)));
console.log(res);
</script>
<script id="jsbin-source-javascript" type="text/javascript">var users = [ { userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5548bf7df73c542a5593d9ed',
name: 'Harry Rose',
email: 'hrose@senseye.io' } ];
var insights = [ { id: '700f3870-4802-4328-b0ba-9a764add0e92',
type: 'comment',
comment: 'more test feedback',
insight: '165ea754-511c-4aaf-8d0e-29486e54b1a1',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:47:04.068Z',
href: '/v1/feedback/insight/700f3870-4802-4328-b0ba-9a764add0e92' },
{ id: '87685cb2-5de2-4e54-926a-066c6663e6cd',
type: 'comment',
comment: 'Testing feedback',
insight: '26ea6aa6-cf84-4128-925c-1c4aaa01066c',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:34:05.281Z',
href: '/v1/feedback/insight/87685cb2-5de2-4e54-926a-066c6663e6cd' },
{ id: 'e1384865-5641-4229-9559-a508ece68d33',
type: 'comment',
comment: 'ever more testing',
insight: '2c22c59a-bf31-4786-abbe-0e7c9097200e',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:52:44.482Z',
href: '/v1/feedback/insight/e1384865-5641-4229-9559-a508ece68d33' },
{ id: '372992ef-9321-4569-8d5d-2eb956052677',
type: 'comment',
comment: 'TC: this is feedback prior to deploying the change to add security to the alert service',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T08:25:05.425Z',
href: '/v1/feedback/insight/372992ef-9321-4569-8d5d-2eb956052677' },
{ id: 'c7b58f71-940f-43ef-94d1-0e01c7545e1f',
type: 'comment',
comment: 'TC post feedback service deploy',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T10:26:24.425Z',
href: '/v1/feedback/insight/c7b58f71-940f-43ef-94d1-0e01c7545e1f' },
{ id: '014954d1-327e-48ee-ad0e-8821600f4ee2',
type: 'positive',
comment: 'testing again',
insight: '5d39aada-f9a2-4c20-a7ab-7707f29058fe',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-20T10:06:56.954Z',
href: '/v1/feedback/insight/014954d1-327e-48ee-ad0e-8821600f4ee2' },
{ id: 'a819210f-da59-4959-b820-864fb6704c17',
type: 'positive',
comment: 'Amazing',
insight: 'a0dedda1-40c7-49a9-a131-fec7bda33d99',
user: 'auth0|5548bf7df73c542a5593d9ed',
created: '2016-06-02T11:01:58.775Z',
href: '/v1/feedback/insight/a819210f-da59-4959-b820-864fb6704c17' },
{ id: '70303d4e-5c4b-4743-9fe6-c475e24a997d',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:34:03.766Z',
href: '/v1/feedback/insight/70303d4e-5c4b-4743-9fe6-c475e24a997d' },
{ id: '9bdf4168-91ff-491a-b0e0-27a3d33e42f5',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:33:49.059Z',
href: '/v1/feedback/insight/9bdf4168-91ff-491a-b0e0-27a3d33e42f5' },
{ id: '15a0c4af-6f2c-4459-b78c-47a8ff569839',
type: 'positive',
comment: 'good stuff',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-19T18:38:22.556Z',
href: '/v1/feedback/insight/15a0c4af-6f2c-4459-b78c-47a8ff569839' } ];
res = insights.map(x => Object.assign(x, users.find(y => y.userid == x.user)));
console.log(res);
</script></body>
</html>
var users = [ { userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5543ad2bc2a1dcdf049478ea',
name: 'Dan Reid',
email: 'dan@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|57c98b3f36c7727f09d5fdcf',
name: 'tim',
email: 'tim.carter@senseye.io' },
{ userid: 'auth0|579a0d9b537ba6681c70b0ca',
name: 'Steven Motes',
email: 'steven.motes@senseye.io' },
{ userid: 'auth0|574426c64bfb594c465a8045',
name: 'Andrew Lowther',
email: 'andrew.lowther@senseye.io' },
{ userid: 'auth0|5548bf7df73c542a5593d9ed',
name: 'Harry Rose',
email: 'hrose@senseye.io' } ];
var insights = [ { id: '700f3870-4802-4328-b0ba-9a764add0e92',
type: 'comment',
comment: 'more test feedback',
insight: '165ea754-511c-4aaf-8d0e-29486e54b1a1',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:47:04.068Z',
href: '/v1/feedback/insight/700f3870-4802-4328-b0ba-9a764add0e92' },
{ id: '87685cb2-5de2-4e54-926a-066c6663e6cd',
type: 'comment',
comment: 'Testing feedback',
insight: '26ea6aa6-cf84-4128-925c-1c4aaa01066c',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:34:05.281Z',
href: '/v1/feedback/insight/87685cb2-5de2-4e54-926a-066c6663e6cd' },
{ id: 'e1384865-5641-4229-9559-a508ece68d33',
type: 'comment',
comment: 'ever more testing',
insight: '2c22c59a-bf31-4786-abbe-0e7c9097200e',
user: 'auth0|574426c64bfb594c465a8045',
created: '2016-07-01T15:52:44.482Z',
href: '/v1/feedback/insight/e1384865-5641-4229-9559-a508ece68d33' },
{ id: '372992ef-9321-4569-8d5d-2eb956052677',
type: 'comment',
comment: 'TC: this is feedback prior to deploying the change to add security to the alert service',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T08:25:05.425Z',
href: '/v1/feedback/insight/372992ef-9321-4569-8d5d-2eb956052677' },
{ id: 'c7b58f71-940f-43ef-94d1-0e01c7545e1f',
type: 'comment',
comment: 'TC post feedback service deploy',
insight: '3282507d-f4ac-4f1d-bb78-0c18e9493c56',
user: 'auth0|57c98b3f36c7727f09d5fdcf',
created: '2016-09-20T10:26:24.425Z',
href: '/v1/feedback/insight/c7b58f71-940f-43ef-94d1-0e01c7545e1f' },
{ id: '014954d1-327e-48ee-ad0e-8821600f4ee2',
type: 'positive',
comment: 'testing again',
insight: '5d39aada-f9a2-4c20-a7ab-7707f29058fe',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-20T10:06:56.954Z',
href: '/v1/feedback/insight/014954d1-327e-48ee-ad0e-8821600f4ee2' },
{ id: 'a819210f-da59-4959-b820-864fb6704c17',
type: 'positive',
comment: 'Amazing',
insight: 'a0dedda1-40c7-49a9-a131-fec7bda33d99',
user: 'auth0|5548bf7df73c542a5593d9ed',
created: '2016-06-02T11:01:58.775Z',
href: '/v1/feedback/insight/a819210f-da59-4959-b820-864fb6704c17' },
{ id: '70303d4e-5c4b-4743-9fe6-c475e24a997d',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:34:03.766Z',
href: '/v1/feedback/insight/70303d4e-5c4b-4743-9fe6-c475e24a997d' },
{ id: '9bdf4168-91ff-491a-b0e0-27a3d33e42f5',
type: 'negative',
comment: 'test comment',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|579a0d9b537ba6681c70b0ca',
created: '2016-08-22T18:33:49.059Z',
href: '/v1/feedback/insight/9bdf4168-91ff-491a-b0e0-27a3d33e42f5' },
{ id: '15a0c4af-6f2c-4459-b78c-47a8ff569839',
type: 'positive',
comment: 'good stuff',
insight: 'a64522c4-30f9-40d9-8ae0-9e990809b51a',
user: 'auth0|5543ad2bc2a1dcdf049478ea',
created: '2016-05-19T18:38:22.556Z',
href: '/v1/feedback/insight/15a0c4af-6f2c-4459-b78c-47a8ff569839' } ];
res = insights.map(x => Object.assign(x, users.find(y => y.userid == x.user)));
console.log(res);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment