Skip to content

Instantly share code, notes, and snippets.

View henrikhaugboelle's full-sized avatar

Henrik Haugbølle henrikhaugboelle

View GitHub Profile
self.MonacoEnvironment = {
baseUrl: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.13.1/min/'
}
importScripts('https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.13.1/min/vs/base/worker/workerMain.js') // eslint-disable-line
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.13.1/min/vs/loader.js"></script>
<script>
require.config({
paths: {
'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.13.1/min/vs'
}
});
window.MonacoEnvironment = {
getWorkerUrl: function (workerId, label) {
@henrikhaugboelle
henrikhaugboelle / app.test.js
Last active February 16, 2021 08:28
Example of running appium locally on android device with jest and async/await.
/**
* Example of running BrowserStacks Appium WikipediaSample test app locally
* using jest and async/await instead of promise chains.
*
* Before running, you should install appium and make sure that all dependencies
* are met with appium-doctor. Get started at:
*
* http://appium.io/docs/en/about-appium/getting-started/?lang=en
*/
module.exports = async () => {
const page = await browser.newPage()
await page.goto('https://www.example.com', {
waitUntil: 'networkidle'
})
// const html = await page.content()
const buffer = await page.screenshot()
await page.close()
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class CatchGlobalClick extends Component {
static propTypes = {
onClick: PropTypes.func,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
])
const input = require('./my-thing.gui')
const parse = (obj, html = "") => {
Object.keys(obj).forEach(key => {
const element = obj[key]
switch (element.type) {
case 'button':
{
"_id" : "N6ZdEa5aYVf76Pnp1Qlq",
...
// This part is new:
"parameters" : {
"worst" : [
"5pZ5QMA9N1IaqVNXYMpX", // worst
"5pag70b0kXHYevkG8aEX" // second corst
]
},
// Use it like in Metrics.js line 26 and forth for graphs.
// Just use "/feed/stress" instead of "/graphs/stress"
const parameters = {
workspaceId: this.props.params.workspaceId
}
Api.post(`/feed/stress`, parameters).then(({ items }) => {
console.log(items[0].date) // timestamp
console.log(items[0].text) // text
// Import dependencies
import React, { Component } from 'react'
// Import styles
import styles from './Panes.scss'
class Panes extends Component {
render() {
return (
<div className={styles.Panes}>
import React, { Component } from 'react'
import styles from './HeroBanner.sass'
import classNames from 'classnames'
import banner from './imgs/banner.jpg'
class HeroBanner extends Component {
render() {
const banner = this.props.banner