Skip to content

Instantly share code, notes, and snippets.

@hon2a
hon2a / .testingWithNightwatch.md
Last active March 2, 2018 15:14
Testing with Nightwatch

Testing with Nightwatch: The Bad and the Ugly

Nightwatch aims to provide an easy-to-use wrapper around Selenium WebDriver. Even though at the time of writing it's quite outdated, compared to other current alternatives, but it's still OK for simple cases. However, trying to build a large, maintainable set of test suites for modestly sized web app uncovers quite a few shortcomings. This text aims to list them and for each one describe both the issue and some way to work around it.

Note that this text is meant to supplement Nightwatch Developer Guide, not replace it.

@hon2a
hon2a / nightOwlForSlack.js
Last active December 5, 2018 09:30
Switch Slack to dark mode at night
// append this to /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', async function() {
// supply your location here, use e.g. https://www.latlong.net/ to find it
const LOCATION = [50.075539, 14.437800]
const MS_IN_DAY = 24 * 60 * 60 * 1000
const initTheme = themeCssUrl => new Promise(resolve => $.ajax({
url: themeCssUrl,
success: css => {
const styleJqueryEl = $('<style>').html(css).appendTo('head')
@hon2a
hon2a / moveIssues.js
Created October 15, 2019 14:18
Move JIRA issues between instances & projects
/**
* 1. Open the old JIRA instance and create a search showing the issues to export.
* Click on _Export > Export Excel CSV (all fields)_.
* 2. Open the new JIRA instance and create a sample issue in it with the fields filled in
* to provide default values for the issues to be imported. Filter for this issue
* in search and export it as above.
* 3. Open https://www.papaparse.com/demo and open the Console from Developer Tools.
* Execute the following code:
*/
const { data: oldIssues } = Papa.parse(OLD_JIRA_CSV_STRING, { header: true })