Skip to content

Instantly share code, notes, and snippets.

View kbastani's full-sized avatar
💭
Coding

Kenny Bastani kbastani

💭
Coding
View GitHub Profile
@kbastani
kbastani / chapter-outline.md
Last active April 7, 2023 18:36
This example shows how OpenAI's GPT technology can write books based off of JSON data describing past, present, and future events

Chronicles of the Enchanted Mage: The Book of Ancient Spells

Chapter 1 - The Enchanted Forest

  • Introduction of Eliana as a young mage who grew up in the Enchanted Forest
  • Training from her mother and discovery of the Book of Ancient Spells

Chapter 2 - The Dark Wizards

  • Eliana and her family are attacked by dark wizards seeking the book
  • Aiden, a skilled swordsman, rescues Eliana
@kbastani
kbastani / pinot-insert.sql
Created September 21, 2022 23:05
Pinot SQL Insert Example
INSERT INTO "baseballStats"
FROM FILE 's3://my-bucket/public_data_set/baseballStats/rawdata/'
OPTION(taskName=myTask-s3)
OPTION(input.fs.className=org.apache.pinot.plugin.filesystem.S3PinotFS)
OPTION(input.fs.prop.accessKey=my-key)
OPTION(input.fs.prop.secretKey=my-secret)
OPTION(input.fs.prop.region=us-west-2)
@kbastani
kbastani / microservices.adoc
Last active September 21, 2022 14:39
Using Graph Analysis to Design Microservice Architectures in the Cloud

Using Graph Analysis to Design Microservice Architectures in the Cloud

This interactive Neo4j graph tutorial covers how to use graph analysis to find software modules that are highly centralized, making good candidates to be decomposed into microservices.


@kbastani
kbastani / 42.md
Last active April 6, 2022 21:17
42

(This is the transcript of a chat bot trained on Wikipedia around 2012)

Q: What is the first thought that comes to your mind when you wake up in the morning?

A: In Douglas Adams' popular comedy book, movie, television, and radio series The Hitchhiker's Guide to the Galaxy, the Answer to the Ultimate Question of Life, the Universe, and Everything is given the numeric solution "42", after seven and a half million years of calculation by a giant supercomputer called Deep Thought.

Q: How does a toddler think, when she cannot produce language herself, but does understand language others speak to her?

@kbastani
kbastani / einstein-riddle-cypher
Created May 13, 2014 21:22
Who owns the fish?
= Logical Graphs =
:neo4j-version: 2.0.3
:author: Kenny Bastani
:twitter: @kennybastani
image::https://c2.staticflickr.com/4/3034/3047586737_9ba0b25fbf.jpg[Who owns the fish?]
There are five houses in five different colours starting from left to right. In each house lives a person of a different nationality. These owners all drink a certain type of beverage, smoke a certain brand of cigarette and keep a certain type of pet. No two owners have the same pet, smoke the same brand or drink the same beverage. The question is: WHO OWNS THE FISH???
== Problem
@kbastani
kbastani / CalendarDay.cql
Last active July 14, 2020 20:36
This gist is a Neo4j Cypher query for merging a calendar graph for a specific year. This query has 4 levels of indexes, consisting of year, month, day, hour.
// Enter the day you would like to create
WITH { day: 18, month: 1, year: 2014 } as dayMap
// Merge hours in a day
MERGE (thisDay:Day { day: dayMap.day, month: dayMap.month, year: dayMap.year })
MERGE (firstHour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: 1 })
CREATE (thisDay)-[:FIRST]->(firstHour)
FOREACH (i IN tail(range(1, 24)) |
MERGE (thishour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i })
MERGE (lasthour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i - 1 })
@kbastani
kbastani / gist:4471127413fd724ed0a3
Last active December 30, 2019 03:38
GraphGist of Neo4j Access Control
= Entitlements and Access Control Management
:neo4j-version: 2.2.0
:author: Kenny Bastani
:twitter: @kennybastani
:description: Graph database access control, entitlements, authorization solutions
:tags: domain:finance, use-case:access-control
This interactive Neo4j graph tutorial covers entitlements and access control scenarios.
'''
@kbastani
kbastani / keybase.md
Created October 2, 2018 01:16
keybase.md

Keybase proof

I hereby claim:

  • I am kbastani on github.
  • I am kbastani (https://keybase.io/kbastani) on keybase.
  • I have a public key ASDY5WBsVgYdDXHnPLnzvgJ7ZtIbPfuJd8VlbJ8yV08yAgo

To claim this, I am signing this object:

@kbastani
kbastani / Aggregate.java
Last active January 21, 2019 12:11
Simpler KStream API Example: See KafkaController.java
public class Aggregate<T> implements Aggregator<Long, KafkaEvent, KafkaEvent> {
private final Class<T> clazz;
private final Aggregator<Long, T, T> aggregation;
public Aggregate(Class<T> clazz, Aggregator<Long, T, T> aggregation) {
this.clazz = clazz;
this.aggregation = aggregation;
}
@kbastani
kbastani / cqrs-es-axon-cf.md
Created September 5, 2018 19:51
CQRS + ES Axon Cloud Foundry