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
<!-- | |
* A collection of various HTML Email hacks | |
** Along with these, user an html boilerplate like https://github.com/seanpowell/Email-Boilerplate | |
** Hacks are from many sources including: | |
** https://litmus.com/blog/a-guide-to-bulletproof-buttons-in-email-design | |
** https://litmus.com/community/discussions/1007-outlook-image-sizes | |
** https://www.emailonacid.com/blog/article/email-development/how-to-code-emails-for-outlook-2016/ | |
--> | |
<!-- 1) Fix image sizes in Outlook --> |
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
//Inspired by https://gist.github.com/aerobless/37561bb0fb45b7e8732beaafad1cba26 | |
pipeline { | |
agent any | |
triggers { | |
//Needed by Bitbucket to see the builds on PRs https://stackoverflow.com/a/54710254 | |
pollSCM('') | |
} | |
stages { |
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
/** Shows how to use code to init data instead of using data.sql or import.sql with Spring Boot */ | |
@Component | |
@Profile({"local", "test"}) | |
@RequiredArgsConstructor //Lombok magic to autowire the final fields (optional) | |
public class LocalDataSetup implements ApplicationRunner { | |
private final MyObjectRepository myObjectRepository; | |
@Override | |
public void run(ApplicationArguments args) { |
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
/** Based nearly completely on this same code from https://stackoverflow.com/a/52534584/1469525 */ | |
@Slf4j | |
public class ColumnRowMapper<T> extends BeanPropertyRowMapper<T> { | |
private ColumnRowMapper(final Class<T> mappedClass) { super(mappedClass); } | |
@Override | |
protected String underscoreName(final String name) { | |
final Column annotation; | |
final String columnName; |
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
/** | |
* Useful when passing the browser timezone to a backend Java API that reads a timezone in using ZoneId.of(tz), | |
* as both 'America/Chicago' and '-0600' are valid values when passed to the Java API. | |
* The Offset is used to handle IE11 and other older browsers. | |
*/ | |
export const getUserTimeZoneOrOffset = () => { | |
let timeZone; | |
try { | |
timeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone; | |
} catch (error) { |
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 React from 'react'; | |
import { screen, render } from '@testing-library/react'; | |
import selectEvent from 'react-select-event'; | |
import CountryComponent from './FakeComponent'; | |
describe('CountryComponent Test', () => { | |
test('form has value of selected option', async () => { | |
render(<CountryComponent />); | |
// react-select let's us update the select value by label, but you must select it by role 'textbox' not a 'select' |
OlderNewer