This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'); | |
var Raven = require('./raven'); | |
var meta = new AWS.MetadataService(); | |
meta.request("/latest/meta-data/instance-id", function(err, data){ | |
Raven.setTagsContext({ | |
EC2InstanceId: data | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raven = require('./raven'); | |
function foo() { | |
try { | |
thowsException(); | |
} catch (err) { | |
raven.captureException(err, { | |
culprit: 'Error from thowsException in foo' | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var raven = require('./raven.js'); | |
function foo() { | |
try { | |
thowsException(); | |
} catch (err) { | |
raven.captureException(err); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Raven = require('raven'); | |
// Configure the Raven client from the Sentry DSN. For local development, keep this environment variable unset to prevent | |
// Raven from sending events to sentry | |
var ravenClient = new Raven.Client(configOptions); | |
var originalCaptureException = ravenClient.captureException; | |
// Monkey patch the captureException function for easier development flow. | |
ravenClient.captureException = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Raven = require('raven'); | |
// Configure the Raven client from the Sentry DSN. For local development, keep this environment variable unset to prevent | |
// Raven from sending events to sentry | |
var ravenClient = new Raven.Client(); | |
// Return the configured Raven client | |
module.exports = ravenClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sync = require('synchronize'); | |
sync.fiber(function() { | |
try { | |
sync.await(func1(sync.defer())); | |
console.log('hits'); | |
} catch (e) { | |
console.log('exception'); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var util = require('util'); | |
var slackWebhookUrl = '<YOUR_SLACK_WEBHOOK_API_URL>'; | |
exports.handler = function(event, context) { | |
var data = convertModulusWebhook(event); | |
var options = { | |
method: 'post', | |
body: data, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = 'This is my string 🙉'; | |
function reverse(input) { | |
var output = '' | |
for (var i=0; i<input.length; i++) { | |
output = input[i] + output; | |
} | |
return output; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = '🙉'; | |
foo.length // what is this string's length? |