(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| @Configuration | |
| @EnableCaching | |
| @ConditionalOnExpression("${spring.cacheable.cache}") | |
| public class EhCacheConfiguration { | |
| @Autowired | |
| private net.sf.ehcache.CacheManager cacheManager; | |
| @Bean(name = "cacheManager") | |
| public CacheManager ehCacheCacheManager() |
| public List<String> randomDictionaryWords() throws IOException { | |
| try (InputStream is = new FileInputStream(new File("/usr/share/dict/words"))) { | |
| BufferedReader br = new BufferedReader(new InputStreamReader(is)); | |
| return br.lines() | |
| .filter(line -> line.length() >= MIN_WORD_LENGTH && line.length() <= MAX_WORD_LENGTH) | |
| .filter(word -> word.equals(word.toLowerCase())) | |
| .filter(word -> random() < DICTIONARY_SAMPLING_RATE) | |
| .limit(50) | |
| .collect(Collectors.toList()); |
| /* | |
| * Copyright (c) 2014, Jay Oster | |
| * All rights reserved. | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions are met: | |
| * | |
| * 1. Redistributions of source code must retain the above copyright notice, | |
| * this list of conditions and the following disclaimer. | |
| * 2. Redistributions in binary form must reproduce the above copyright notice, |
| gsub = function(source, pattern, replacement) { | |
| var match, result; | |
| if (!((pattern != null) && (replacement != null))) { | |
| return source; | |
| } | |
| result = ''; | |
| while (source.length > 0) { | |
| if ((match = source.match(pattern))) { | |
| result += source.slice(0, match.index); | |
| result += (typeof replacement === 'function') ? replacement(match[0]) : replacement; |
| /** | |
| * (Note: Depends on window.requestAnimationFrame for polling.) | |
| * | |
| * An experimental Gamepad object for detecting | |
| * and parsing gamepad input. | |
| * | |
| * Current code borrows heavily from Marcin Wichary's work: | |
| * http://www.html5rocks.com/en/tutorials/doodles/gamepad/ | |
| * | |
| * Also uses deadzone values from |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| indent_style = space | |
| indent_size = 4 | |
| [*.java] | |
| insert_final_newline = true |
| # INSTALL AND CONFIGURE BEES SDK | |
| export BEES_HOME=/opt/cloudbees/cloudbees-sdk/ | |
| export PATH=$PATH:$BEES_HOME | |
| if [ ! -d ~/.bees ]; then | |
| bees init -f -a <account name> -ep us -k $BEES_API -s $BEES_SECRET | |
| fi | |
| bees plugin:install com.cloudbees.sdk.plugins:bg-plugin | |
| # DEPLOY |
| driver.executeScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "border: 2px solid yellow; color: yellow; font-weight: bold;") |