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
'use strict'; | |
// ENV vars | |
const AWS_REGION_STRING = process.env.AWS_REGION || 'us-east-1'; | |
const AWS_ACCOUNT_ID = process.env.AWS_ACCOUNT_ID; | |
const SNS_TOPIC_NAME = process.env.SNS_TOPIC_NAME; | |
const SNS_TOPIC_ARN = `arn:aws:sns:${AWS_REGION_STRING}:${AWS_ACCOUNT_ID}:${SNS_TOPIC_NAME}`; | |
const AWS = require('aws-sdk'); | |
AWS.config.update({ |
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
./parent.rb | |
command: ./child.rb 1 | |
2018-09-12 14:32:09: stdout | |
2018-09-12 14:32:09: stderr | |
2018-09-12 14:32:11: stdout | |
2018-09-12 14:32:11: stderr | |
pid 97509 exit 1 | |
97509 | |
false | |
command: ./child.rb 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
# usage | |
nvm use . | |
npm install | |
chmod +x export-spark-driver-logs.sh | |
./export-spark-driver-logs.sh $ES_IP:$ES_PORT driver-##############-#### |
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
Map<String, Long> counted = list.stream() | |
.collect(Collectors.groupingBy(Function.identity(), Collectors.counting())); | |
Map<String, Long> sorted = counted.entrySet().stream() | |
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue())) | |
.limit(10) | |
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new)); |
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
let method1 = function() { | |
console.log("method1") | |
return true | |
} | |
let method2 = function() { | |
console.log("method2") | |
return true | |
} |
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
# check if a specifc version is avaiable to install | |
brew search python@ | |
==> Searching local taps... | |
python@3 [email protected] ipython@6 | |
[email protected] ipython@5 python@2 | |
# confirm semantic/minor version of package | |
brew info python@3 | head -1 | |
python3: stable 3.6.4 (bottled), devel 3.7.0a3, HEAD | |
# ^ in this case, I want 3.5.x |
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
//////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Custom UDF | |
//////////////////////////////////////////////////////////////////////////////////////////////////// | |
// define method | |
def isNumeric: (String => Boolean) = { | |
case null => false | |
case value => value forall Character.isDigit | |
} | |
val ISNUMERIC = udf(isNumeric) |
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
#!/usr/bin/env ruby | |
require 'json' | |
require 'net/http' | |
require 'open-uri' | |
require 'pp' | |
require 'uri' | |
ZEP_HOST = 'localhost' | |
ZEP_PORT = 8890 |
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
FROM busybox | |
ARG MESSAGE | |
RUN echo $MESSAGE > message.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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'json' | |
require 'pp' | |
ZEP_HOST = 'localhost' | |
ZEP_PORT = 8890 | |
ZEP_ADDR = "http://#{ZEP_HOST}:#{ZEP_PORT}" |