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 Chart = () => { | |
| return ( | |
| <ResponsiveContainer> | |
| <Chart data={data}> | |
| <XAxis /> | |
| <YAxis /> | |
| <CartesianGrid /> | |
| <Line isAnimationActive={false} dataKey="y"> | |
| <LabelList dataKey="note" position="top" /> | |
| </Line> |
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 saveStuffToBackend = stuff => { | |
| saveToBackend(stuff); | |
| } | |
| const genRowPartial = (foo) => (bar) => { | |
| const [baz, setBaz] = useState(0); | |
| return ( | |
| <tr><td><input value={baz} onChange={e => setBaz(e.target.value)} onBlur={() => saveStuffToBackend(baz)} /></td></tr> | |
| ); |
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
| class Blah { | |
| foo: null, | |
| someModel: null, | |
| constructor(args) { | |
| someModel = args.someModel; | |
| foo = new Foo({ | |
| "fn": a | |
| }); |
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 com.amazonaws.AmazonServiceException; | |
| import com.amazonaws.SdkClientException; | |
| import com.amazonaws.auth.AWSStaticCredentialsProvider; | |
| import com.amazonaws.auth.BasicAWSCredentials; | |
| import com.amazonaws.regions.Regions; | |
| import com.amazonaws.services.s3.AmazonS3; | |
| import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
| import com.amazonaws.services.s3.model.ObjectMetadata; | |
| import com.amazonaws.services.s3.model.PutObjectRequest; | |
| import org.slf4j.Logger; |
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
| class MyTest { | |
| //... | |
| private WebDriver driver; | |
| @RegisterExtension | |
| TakeScreenshotOnFailureExtension takeScreenshotOnFailureExtension = new TakeScreenshotOnFailureExtension(driver); | |
| //... | |
| } |
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 com.amazonaws.SdkClientException; | |
| import org.junit.jupiter.api.extension.ExtensionContext; | |
| import org.junit.jupiter.api.extension.TestExecutionExceptionHandler; | |
| import org.openqa.selenium.OutputType; | |
| import org.openqa.selenium.TakesScreenshot; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.WebDriverException; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |
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
| class Reminder < ApplicationRecord | |
| attr_accessor :reminder_text, :reminder_date | |
| end |
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
| <T> T waitUntil(Function<? super WebDriver, T> condition, int timeout, int pollingEvery, Class<? extends Throwable>... exceptions) { | |
| Wait<WebDriver> wait = new FluentWait<>(driver) | |
| .withTimeout(timeout, SECONDS) | |
| .pollingEvery(pollingEvery, MILLISECONDS) | |
| .ignoreAll(Arrays.asList(exceptions)); | |
| return wait.until(condition); | |
| } |
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
| List<Container> containers = session.createNativeQuery("select * from containers c", Container.class) | |
| .list(); | |
| containers.forEach(container -> { | |
| SubEntity subEntity = session.createNativeQuery("select * from subEntity se join containers c on se.id = c.fk_se where c.id = :id") | |
| .setParameter("id", container.getId()) | |
| .uniqueResult(); | |
| container.setSubEntity(subEntity); | |
| }); |
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
| export default class App extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| diceType: 6, | |
| diceNumber: 2, | |
| }; | |
| } | |
| render() { |
NewerOlder