This gist initialized a jumpbox
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
# restart heroku dyno | |
curl --location --request DELETE 'https://api.heroku.com/apps/web-scrap-amazon-wishlist/dynos/web' \ | |
--header 'Accept: application/vnd.heroku+json; version=3' \ | |
--header 'Authorization: Bearer <token-api>' | |
# stop heroku dyno | |
curl --location --request POST 'https://api.heroku.com/apps/web-scrap-amazon-wishlist/dynos/web/actions/stop' \ | |
--header 'Accept: application/vnd.heroku+json; version=3' \ | |
--header 'Authorization: Bearer <token-api>' |
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
public interface MyService { | |
String print(); | |
} | |
@Service("service1") | |
public class MyFirstService implements MyService { | |
@Override | |
public String print() {return "service ONE";} | |
} |
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 SOURCE_LANGUAGE = "en"; | |
const TARGET_LANGUAGE = "pt-br"; | |
const button = document.createElement('button'); | |
button.textContent = 'copy and translate'; | |
button.addEventListener('click', () => { | |
const subtitleElement = document.getElementsByClassName('captions-text')[0]; | |
const selectedTexts = Array.from(subtitleElement.children) | |
.map(i => i.children[0]) | |
.map(i => i.innerHTML.replace('<br>', '').replace(' ', '')) | |
.join(' '); |
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 SOURCE_LANGUAGE = "en"; | |
const TARGET_LANGUAGE = "pt-br"; | |
const button = document.createElement('button'); | |
button.textContent = 'translate'; | |
button.addEventListener('click', () => { | |
const subtitleElement1 = document.getElementsByClassName('player-timedtext-text-container')[0]?.children[0]?.children[0]; | |
const subtitleElement2 = document.getElementsByClassName('player-timedtext-text-container')[1]?.children[0]?.children[0]; | |
const selectedTexts = Array.from([subtitleElement1, subtitleElement2]) | |
.filter(i => !!i) | |
.map(i => i.innerHTML.replaceAll('<br>', '').replaceAll(' ', '')) |
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 _ = require('lodash') | |
const SETTINGS = { | |
header_background_color: value(/whitelabel\.header_background_color/g), | |
footer_background_color: value(/whitelabel\.footer_background_color/g), | |
footer_sections: array(/whitelabel\.footer_sections\../g, 2), | |
footer_sections_title: value(/whitelabel\.footer_sections\..\.title/g), | |
footer_sections_links: array(/whitelabel\.footer_sections\..\.links\../g, 4), | |
footer_sections_links_title: value(/whitelabel\.footer_sections\..\.links\..\.title/g), | |
footer_sections_links_tooltip: value(/whitelabel\.footer_sections\..\.links\..\.tooltip/g), |
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.List; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
public class Product { | |
private final long id; | |
private final String description; |
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 org.junit.Test; | |
public class StringRotationCompactCode { | |
@Test | |
public void test() { | |
System.err.println("abcde => eabcd: " + isRotation("abcde", "eabcd")); | |
System.err.println("abcde => cdeab: " + isRotation("abcde", "cdeab")); | |
System.err.println("abcde => abced: " + isRotation("abcde", "abced")); | |
System.err.println("abc => a: " + isRotation("abc", "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
public class Food { | |
private String pizza; | |
private String hamburger; | |
public String getPizza() { | |
return pizza; | |
} | |
public void setPizza(String pizza) { | |
this.pizza = pizza; |