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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content="SOMA 01 - Hello World"> | |
<title>SOMA 01 - Hello World</title> | |
</head> | |
<body> | |
<div id="page"></div> | |
<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="data-binding"> | |
</head> | |
<body> | |
<script src="https://d3js.org/d3.v4.min.js" charset=" utf-8"></script> | |
<script> | |
var selector = d3.select('body') | |
.selectAll('span') |
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
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
# sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |
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
license: gpl-3.0 | |
height: 960 | |
border: no |
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
// Este script é para rodar no Ammonite. | |
// Crie o arquivo catalyst_04.sc com este conteúdo | |
// Dentro da shell REPL do Ammonitem, você deve invocar assim: | |
// import $file.catalyst_04, catalyst_04._ | |
// | |
// Mas antes execute estes tres comandos abaixo | |
// import coursier.MavenRepository | |
// interp.repositories() ++= Seq(MavenRepository("file:/Users/admin/.m2/repository")) | |
// import $ivy.`org.apache.spark::spark-sql:2.3.0` |
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
# Usando o Kubernetes com Docker in Docker (DIND) | |
sudo mkdir -p /usr/local | |
cd /usr/local | |
sudo mkdir dind-cluster | |
cd dind-cluster/ | |
sudo chmod o+w . | |
ls -lat .. | head | |
# wget https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.10.sh | |
curl -O https://cdn.rawgit.com/kubernetes-sigs/kubeadm-dind-cluster/master/fixed/dind-cluster-v1.10.sh |
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
def happyEmployees(salary: Int) => salary > 2200 | |
def smartTextCase(name: String) => name.toUpperCase() |
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.SparkSession.Builder | |
import org.apache.spark.SparkContext | |
import org.apache.log4j.{Level, Logger} | |
// A sparkSession é provida pelo proprio Spark Shell | |
// O nivel de log também já é configurado pela Spark Shell | |
def boolean_udf_wrapper(a:String, b:String, t:Any): Boolean = { true } | |
def string_udf_wrapper(a:String, b:String, t:Any): String = { "••••" } | |
import org.apache.spark.sql.functions.expr | |
import org.apache.spark.sql.functions.sum |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.