This file contains 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
package be.icteam.sample | |
import cats.effect._ | |
import cats.implicits._ | |
import cats.effect.concurrent.Semaphore | |
import java.util.concurrent.Executors | |
import scala.concurrent.ExecutionContext | |
This file contains 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
git branch -m master main && \ | |
git fetch origin && \ | |
git branch -u origin/main main && \ | |
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main |
This file contains 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
name: "Terraform" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
terraform: |
This file contains 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 | |
#set -x | |
partitions_between() { | |
local from=$1 | |
local to=$2 | |
local offset_in_seconds=$3 | |
local fmt=$4 | |
current=$from |
This file contains 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
aws ec2 describe-regions | \ | |
jq -r '.Regions[] | .RegionName' | \ | |
xargs -l aws resourcegroupstaggingapi get-resources --region | \ | |
jq '.ResourceTagMappingList[] | .ResourceARN' |
This file contains 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
# get token from https://github.com/settings/tokens (repo and delete_repo permissions) | |
export TOKEN="" | |
curl -H "Authorization: token $TOKEN" https://api.github.com/user/repos | \ | |
jq '.[].full_name' | \ | |
grep demo | \ | |
gxargs -I '{}' curl -H "Authorization: token $TOKEN" -X DELETE https://api.github.com/repos/'{}' |
This file contains 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 | |
# Export variables if not set already | |
export CLOUDKARAFKA_BROKERS="${CLOUDKARAFKA_BROKERS:-ark-01.srvs.cloudkafka.com:9094,ark-02.srvs.cloudkafka.com:9094,ark-03.srvs.cloudkafka.com:9094}" | |
export CLOUDKARAFKA_USERNAME="${CLOUDKARAFKA_USERNAME:-herecomesyourusername}" | |
export CLOUDKARAFKA_PASSWORD="${CLOUDKARAFKA_PASSWORD:-herecomesyourpassword}" |
This file contains 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 scala.xml.XML | |
import ammonite.ops._ | |
import ammonite.ops.ImplicitWd._ | |
val tempFile = File.createTempFile("tmp", "tmp") | |
tempFile.deleteOnExit() | |
val f = tempFile.getAbsolutePath | |
val res = %%('mvn, "help:effective-pom", s"-Doutput=${f}") | |
val xml = XML.loadFile(f) |
This file contains 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
trait IHaveLakeName { | |
def lakeName: String | |
} | |
trait IHaveStreamName { | |
def streamName: String | |
} | |
trait IHaveLakeAndStreamName extends IHaveLakeName with IHaveStreamName |
This file contains 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 org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.cassandra._ | |
import com.datastax.spark.connector.cql.CassandraConnectorConf.ConnectionHostParam | |
import com.datastax.spark.connector.cql.DefaultAuthConfFactory.{PasswordParam, UserNameParam} | |
val spark = { | |
SparkSession | |
.builder() | |
.master("local[*]") | |
.appName("test") |