Skip to content

Instantly share code, notes, and snippets.

View eusouodaniel's full-sized avatar
🎯
Focusing

Daniel Silva eusouodaniel

🎯
Focusing
View GitHub Profile
@eusouodaniel
eusouodaniel / main.yaml
Created February 27, 2026 20:17
k8s-objects-used
apiVersion: v1
kind: Pod
metadata:
name: user-service
namespace: app
spec:
containers:
- name: user-service
package com.ratingMovie.spark
import org.apache.spark.SparkContext
object SparkCountRating {
def main(args: Array[String]): Unit = {
val sparkContext = new SparkContext("local[*]", "SparkCountRating")
var data = sparkContext.textFile("ratings.csv")
from pyspark import SparkContext, SparkConf
config = SparkConf().setAppName("WordCount")
sparkContext = SparkContext.getOrCreate()
content = sc.textFile("words.txt")
filter_empty_lines = content.filter(lambda x: len(x) > 0)
words = filter_empty_lines.flatMap(lambda x: x.split(' '))
counts = words.map(lambda x:(x,1)).reduceByKey(lambda x, y: x + y).map(lambda x: (x[1], x[0])).sortByKey(False)
db.airbnb.find({"$and":[{"reviews.comments":
{"$regex": '/best place tobe/'}},
{"name": {"$regex": 'Cobertura'}},
{"reviews.comments": {"$regex": 'Lugar muito aconchegante'}},
{"reviews.comments": {"$regex": 'Ótimo host'}},
{"host_location": {"$regex": 'São Paulo'}},
{"host_response_time": {"$regex": 'hour'}},
]}
).pretty()
FROM node:10-alpine as buildContainer
RUN ["mkdir", "/app"]
WORKDIR /app
COPY package.json /app
RUN ["npm", "install"]
function run(value) {
var message = '';
[].map.call(value, function (character) {
message += cripty(character);
});
return message;
}