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
const { writeFile, mkdirSync, existsSync } = require('fs'); | |
/** | |
* Handles taking and saving screenshots in browserstack environment. | |
*/ | |
class Screenshoter { | |
/** | |
* @param capabilityName name of capability used for saving the screenshots (must be valid for file names) | |
*/ | |
constructor(capabilityName) { |
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
const fs = require('fs'); | |
const jsonServer = require('json-server'); | |
class MockServer { | |
constructor(logEnabled = false) { | |
fs.copyFileSync(__dirname + '/db.json', __dirname + '/db_session.json'); | |
this.logEnabled = logEnabled; | |
this.application = jsonServer.create(); |
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
return ReplicationBuilder.forObject(state) | |
.property('party').replaceValueOf('name').with('MyParty').replaceValueOf('members').by((members) => [...members, newMember]) | |
.property('initiator').replaceValueOf('prename').with('Party').replaceValueOf('surname').with('guy') | |
.build(); |
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
// simply replace property by with new value | |
return ReplicationBuilder.forObject(state).property('party') .replaceValueOf('name').with('MyParty') .build() | |
// replace property depending on old value | |
return ReplicationBuilder.forObject(state).property('party') | |
.replaceValueOf('partymemberArray').by((oldPartymemberArray) => [...oldPartymemberArray, 'new partymember']) | |
.build() | |
// clone property and apply some function on it | |
return ReplicationBuilder.forObject(state) |
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
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.function.Function; | |
import javafx.beans.property.ListProperty; | |
import javafx.beans.property.Property; | |
import javafx.beans.property.SimpleListProperty; | |
import javafx.collections.FXCollections; | |
import javafx.collections.ListChangeListener; |
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
.loadingWrapper { | |
display: inline-block; | |
} | |
.loadingSpinner { | |
margin-left: 5px !important; | |
display: inline-block; | |
height: 15px !important; | |
position: relative; | |
top: 2px; |
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
define(['react', 'react-dom', 'lodash', './LoadingWrapper.rt'], function (React, ReactDOM, _, template) { | |
'use strict'; | |
return React.createClass({ | |
displayName: 'LoadingWrapper', | |
render: template, | |
propTypes: { | |
isLoading: React.PropTypes.bool.isRequired, | |
loadingText: React.PropTypes.string | |
}, |
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
<div class="loadingWrapper" | |
rt-class="{centered: this.props.center === 'true' && !this.state.loadingEnded, fullWidth: this.props.fullWidth === 'true'}"> | |
<div ref="loadingContainer" key="loadingContainer" rt-if="!this.state.loadingEnded"> | |
<div class="sk-spinner sk-spinner-wave loadingSpinner"> | |
<div class="sk-rect1" /> | |
<div class="sk-rect2" /> | |
<div class="sk-rect3" /> | |
<div class="sk-rect4" /> | |
<div class="sk-rect5" /> | |
</div> |
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
import javax.ws.rs.client.ClientBuilder; | |
import javax.ws.rs.client.WebTarget; | |
import javax.ws.rs.core.GenericType; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLEncoder; | |
import java.nio.charset.StandardCharsets; | |
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; | |
import org.glassfish.jersey.jackson.JacksonFeature; |
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
import javax.ws.rs.core.Response; | |
import java.text.MessageFormat; | |
import java.util.logging.Logger; | |
public class RestClient | |
{ | |
private final static Logger LOGGER = Logger.getLogger( RestRequest.class.getSimpleName() ); | |
private String username; |
NewerOlder