Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

Kenny Bastani kbastani

💭
Coding
View GitHub Profile
View 42.md

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?

A: To contribute to the well-being and spirit of others.

View 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 / cqrs-es-axon-cf.md
Created Sep 5, 2018
CQRS + ES Axon Cloud Foundry
View cqrs-es-axon-cf.md
@kbastani
kbastani / Aggregate.java
Last active Jan 21, 2019
Simpler KStream API Example: See KafkaController.java
View Aggregate.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 / .block
Created Jun 3, 2017
Force-directed Graph Voronoi Sphere
View .block
license: gpl-3.0
@kbastani
kbastani / .block
Created Jun 3, 2017
Force-directed Graph Voronoi Diagram
View .block
license: gpl-3.0
View tla.tla
VARIABLE clock
Init == clock \in {0, 1}
Tick == IF clock = 0 THEN clock' = 1 ELSE clock' = 0
Spec == Init /\ [][Tick]_<<clock>>
@kbastani
kbastani / mvnw-fix.sh
Last active Jun 24, 2021
Adds a settings.xml file to your Spring Boot maven wrapper
View mvnw-fix.sh
#!/usr/bin/env bash
# Secure workaround for https://issues.sonatype.org/browse/MVNCENTRAL-1369
# Navigate to the root of your Spring Boot project where a Maven wrapper is present and run this script
cd .mvn/wrapper
wget https://gist.githubusercontent.com/kbastani/d4b4c92969ec5a22681bb3daa4a80343/raw/f166086ef051369383b02dfb74317cd07b6f2c6e/settings.xml
cd ../../
./mvnw clean install -s .mvn/wrapper/settings.xml
View User.java
package com.example;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class User {
@kbastani
kbastani / WebConfig.java
Created Sep 9, 2015
How to support XML as a Spring WebMvc REST service
View WebConfig.java
@EnableWebMvc
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
messageConverters.add(createXmlHttpMessageConverter());
messageConverters.add(new MappingJackson2HttpMessageConverter());
super.configureMessageConverters(converters);