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
#!/bin/bash | |
echo "Install MiniShift on MacOS: " | |
echo " Note: assumes machine not pre-setup with prerequisites!!!" | |
brew update | |
echo "Install Homebrew Casks:" | |
brew install caskroom/cask/brew-cask |
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
#!/bin/bash | |
echo "Add the following to your ~/.bashrc file and run 'source ~/.bashrc'" | |
alias jshell=`echo $(/usr/libexec/java_home)`/bin/jshell |
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.io.ByteArrayInputStream; | |
import java.io.Console; | |
import java.util.List; | |
import jdk.jshell.*; | |
import jdk.jshell.Snippet.Status; | |
class ExampleJShell { | |
public static void main(String[] args) { | |
Console console = System.console(); | |
try (JShell js = JShell.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
Optional<String> name = Optional.empty(); | |
Optional<String> alternativeName = Optional.of("john"); | |
name = name.or(() -> alternativeName); | |
name.get(); // Outputs "john" |
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 asyncio | |
from pymongo import MongoClient | |
@asyncio.coroutine | |
def periodic(wait_seconds=2): | |
while True: | |
names = client['local'].collection_names() | |
for name in names: | |
print(name) | |
yield from asyncio.sleep(wait_seconds) |
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
python -c "import site; print(site.getsitepackages())" |
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 redis.clients.jedis.Jedis; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import static java.lang.System.getenv; | |
public class JavaRedisCSVUploadExample { |
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 urllib | |
import re | |
def getSequenceDiagram(text, output_file, style ='default'): | |
request = {} | |
request["message"] = text | |
request["style"] = style | |
request["apiVersion"] = "1" | |
url = urllib.urlencode(request) |
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
def nodeName | |
stage("ArchiveDockerData") { | |
def nodeNameList = nodeNames() | |
for (String n : nodeNameList) { | |
nodeName = n | |
echo "Docker info for ${nodeName}" | |
timeout(time: 5, unit: 'SECONDS') { | |
try { | |
node(nodeName) { |
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
@Configuration | |
public class ThymeLeafConfig { | |
@Autowired | |
private SpringResourceTemplateResolver templateResolver; | |
@Bean | |
public SpringTemplateEngine templateEngine(){ | |
SpringTemplateEngine templateEngine = new SpringTemplateEngine(); | |
templateEngine.setEnableSpringELCompiler(true); |