Creates a step in Amazon EMR for a given cluster_id
and monitors it's progress using a sensor. A more complex example, that involves cluster creation/termination can be found here.
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 | |
# | |
# Access Docker containers running on ECS/Fargate using SSH. | |
# | |
# You'll need to install the Session Manager plugin for the `aws` command for this to | |
# work properly. On macOS: `brew install session-manager-plugin`. | |
# | |
# References: | |
# * https://gist.github.com/sjednac/c877e8e8dc09d6e2279209dfc7d9d4f8 (source code) | |
# * https://aws.amazon.com/blogs/containers/new-using-amazon-ecs-exec-access-your-containers-fargate-ec2/ |
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
Show hidden characters
{ | |
// Place your frlncr workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
"Component Typescript": { | |
"scope": "typescript,typescriptreact", |
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 React from 'react' | |
import PropTypes from 'prop-types' | |
import { | |
isEqual, | |
includes | |
} from 'lodash' | |
class DelayedList extends React.Component { | |
constructor(props) { |
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 Double.NaN | |
object FillMissingValues1 extends App { | |
val data = List(1.0, NaN, 2.0, NaN, NaN, 3.0, 4.0, NaN, 5.0, NaN) | |
val res = data.scanLeft(0.0)( (current, item) => if (item.isNaN) current else item) | |
println(res) | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; | |
namespace knn | |
{ | |
class MainClass | |
{ | |
public struct Record |
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
lazy val person = settingKey[String]("Person to greet") | |
lazy val hello = taskKey[Unit]("Greet person") | |
// https://stackoverflow.com/q/14262798/1535738 | |
def greetEveryone = Command.command("greetEveryone") { state => | |
Seq("John", "Alice", "Bob").foreach { name => | |
val extracted = Project extract state | |
val newState = extracted.append(Seq(person := name), state) | |
Project.extract(newState).runTask(hello, newState) |
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
# | |
# A Kafka consumer, that will print schema version information for | |
# all available subjects. | |
# | |
# Use the RESTful API to query SchemaRegistry directly. For example: | |
# curl http://schema-registry:8081/subjects/{subject}/versions | |
# | |
from kafka import KafkaConsumer | |
from random import randint |
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
object EmojiMeal extends App { | |
type Ingredient = String | |
type Meal = String | |
type Person = String | |
type Poop = String | |
def cook(item: Ingredient): Meal = item match { | |
case "🐮" => "🍔" | |
case "🍠" => "🍟" | |
case "🐔" => "🍗" |
NewerOlder