Skip to content

Instantly share code, notes, and snippets.

View crocker's full-sized avatar

Jason Crocker crocker

  • Clinetic
  • Raleigh, NC
View GitHub Profile
val today = LocalDate.now
val todayTransactions = spark.read
.option("header", "true")
.option("inferSchema", "true")
.json(s"s3n://bucket-name/${today}/transaction.json")
val yesterdayTransactions = spark.read
.option("header", "true")
.option("inferSchema", "true")
@crocker
crocker / es-basic-histogram-aggregation.json
Created March 12, 2017 20:57
Basic Elasticsearch histogram
{
"aggs": {
"histogram": {
"date_histogram": {
"field": "date",
"interval": "month"
}
}
}
}
@crocker
crocker / auth0-stripe.js
Created January 28, 2022 02:54
Auth0 Rule - Create/Update Stripe Customer on Auth0 Login
function (user, context, callback) {
var stripe = require('stripe')('sk_test....');
user.app_metadata = user.app_metadata || {};
var customer = {
email: user.email,
name: user.name
};
if ('stripe_customer_id' in user.app_metadata) {