Skip to content

Instantly share code, notes, and snippets.

Nazreen nazreen

Block or report user

Report or block nazreen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@nazreen
nazreen / 0.js
Created Apr 17, 2019
2019-04-16 process.on('unresolvedPromise')
View 0.js
// in index.js
...
async function handler(event, context) {
try {
return handlerService.call(event, context, { AWS })
} catch (e) {
if (process.env.NODE_ENV === 'local') throw e
throw JSON.stringify(e)
@nazreen
nazreen / index.js
Created Jul 14, 2018
determine number of live promises by live politicians
View index.js
const politicians = require('./politicians.json')
const promises = require('./promises.json') // live promises
const result = {
promisesWithLivePoliticians: {
total: 0
},
promisesWithOfflinePoliticians: {
total: 0
}
@nazreen
nazreen / areObjectsSimilar.js
Created Nov 18, 2017
Javascript utility function to compare 2 objects.
View areObjectsSimilar.js
function logDifference(arr1, arr2) {
let difference = arr1.filter(
x => arr2.indexOf(x) == -1)
.concat(arr2.filter(
x => arr1.indexOf(x) == -1)
);
if (difference.length < 1) return []; // if no difference return empty array
return difference;
You can’t perform that action at this time.