This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains 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
export default class MyClass { | |
constructor(x) { | |
this.val= x ? x: 'Hello!' | |
console.log(`MyClass: ${x}`) | |
} | |
} |
This file contains 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
addStepsAttachments(fileName, folder, callback) { | |
fileName = '12345'; | |
fs.readdir(folder, 'utf8', function(err, filesList) { | |
if (!err && filesList.length > 0) { | |
const results = []; | |
const matchingFiles = filesList | |
.filter(file => file.startsWith(fileName)) | |
.map(file => path.resolve(folder, file)); | |
// just in case there were no matching files |
This file contains 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
// @see package.json#browser field | |
const Raven = require('raven') | |
if (process.env.NODE_ENV === 'production') { | |
Raven.config('YOUR_SENTRY_DSN').install() | |
} | |
module.exports = Raven |
This file contains 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
/** | |
* Code which I test on twitter.com | |
* Both tests were runing in Chrome 35.x dev tools | |
* | |
* This test just gets all a tags from html and read their content | |
* and then write it on end of document (body element) | |
* | |
**/ | |
This file contains 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 id = 'id' + (Math.random()*1e6|0).toString(16); | |
document.write('<script id="' + id + '" type="text/noexec"></script>'); | |
var marker = document.getElementById(id); | |
alert(marker.previousElementSibling.src||'inline'); | |
marker.parentNode.removeChild(marker); |