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
| cat data/inventory.txt| while read -r line; | |
| do echo $line |tr -d "\n" |nc -c localhost 3001 ; echo ; done < data/inventory.txt/ |
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.*; | |
| import java.util.*; | |
| import java.util.function.*; | |
| import java.util.stream.*; | |
| public class LengthPrefixedUnframer implements Supplier<Message> { | |
| private final InputStream in; | |
| private Message msg = new Message(new byte[0]); | |
| private int counter = 0; |
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.*; | |
| import java.util.*; | |
| import java.util.concurrent.atomic.*; | |
| // Options for NOOP collector: | |
| // -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC | |
| public class ExercisePriceLevels { | |
| class Order { |
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 | |
| [ -z ${2} ] && echo "Usage: ${0} <longitude> <latitude>" && exit 1 | |
| http -F $(http -F "https://api.weather.gov/points/${1},${2}" \ | |
| | json .properties.forecastHourly) \ | |
| | json -a .properties.periods \ | |
| | json -a .endTime .temperature .temperatureUnit .windSpeed .windDirection .shortForecast |
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 | |
| for HOUR in $(seq -w 0 23) | |
| do | |
| for MINUTE in 00 15 30 45 | |
| do | |
| SLICE=$(date +%Y%m%d_${HOUR}${MINUTE}) | |
| echo SPPHLXNP6905_${SLICE} | |
| done | |
| done |
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
| // elem: DOM element housing the template | |
| // obj: object containing values corresponding to template slots | |
| function mapSlots(elem, obj) { | |
| if (obj) { | |
| Object.keys(obj).forEach(function(key) { | |
| let slot = elem.querySelectorAll(`slot[name='${key}']`); | |
| if (slot[0]) { | |
| slot[0].innerHTML = obj[key]; | |
| } |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe" | |
| package="baseline" | |
| id="1" | |
| version="0" | |
| semanticVersion="5.2" | |
| description="Example base schema which can be extended." | |
| byteOrder="bigEndian"> | |
| <types> | |
| <type name="timestamp_nanos_midnight" primitiveType="uint32" length="6"/> |
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 formatter = {}; | |
| export const mapToDom = function (index, object) { | |
| const keys = Object.keys(object); | |
| keys.forEach(function (key) { | |
| const element = index !== undefined | |
| ? `${index}-${key}` | |
| : `${key}`; | |
| const domElem = document.getElementById(element); | |
| if (domElem) { |
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
| while read -r line | |
| do | |
| export UOM=$(echo ${line} | cut -f1 -d" ") | |
| export s=" " | |
| export DESC=${line#*$s} | |
| echo "<value enum='${UOM}' description='${DESC}'/>" | |
| done < /var/tmp/uom.txt |
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 LINE_COUNT=$(wc -l ${1} | cut -f1 -d" ") | |
| for i in $(seq ${LINE_COUNT}) | |
| do head -$i ${1} | tail -1 | base64 -d | head -c2 | od -xL | head -2 | tail -1 | |
| done |
NewerOlder