Skip to content

Instantly share code, notes, and snippets.

View recursivecodes's full-sized avatar
💯
Living the dream

Todd Sharp recursivecodes

💯
Living the dream
View GitHub Profile
@recursivecodes
recursivecodes / BttcConsumer.java
Created February 23, 2022 18:45
BttcConsumer.java
@MqttSubscriber
public class BttcConsumer {
private static final Logger LOG = LoggerFactory.getLogger(BttcConsumer.class);
private final BrainRepository brainRepository;
private final WebSocketBroadcaster broadcaster;
public BttcConsumer(
BrainRepository brainRepository,
WebSocketBroadcaster broadcaster) {
this.brainRepository = brainRepository;
@recursivecodes
recursivecodes / application.yml
Created February 23, 2022 18:45
application.yml
mqtt:
client:
server-uri: ${MQTT_SERVER_URI}
client-id: bttc-client
user-name: ${MQTT_USERNAME}
password: ${MQTT_PASSWORD}
@recursivecodes
recursivecodes / bootstrap.yml
Created February 23, 2022 18:45
bootstrap.yml
oraclecloud:
vault:
config:
enabled: true
vaults:
- ocid: ${VAULT_OCID}
compartment-ocid: ${VAULT_COMPARTMENT_OCID}
use-instance-principal: false
path-to-config: ~/.oci/config
profile: DEFAULT
@recursivecodes
recursivecodes / select_from_mv_game_details.sql
Created February 23, 2022 18:45
select_from_mv_game_details.sql
select
map,
"mode",
cast( avg(kills) as number(18,2)) as avgKills
from mv_game_details
group by map, "mode";
@recursivecodes
recursivecodes / GameRepository.java
Created February 23, 2022 18:45
GameRepository.java
@Repository
public interface GameRepository extends PageableRepository<Game, Long> {}
@recursivecodes
recursivecodes / getSummaryByRange.sql
Created February 23, 2022 18:45
getSummaryByRange.sql
select *
from summaryByRange('attention');
@recursivecodes
recursivecodes / vw_summary_by_meditation_range.sql
Created February 23, 2022 18:45
vw_summary_by_meditation_range.sql
select
case
when avgMeditation >= 1 and avgMeditation <= 10 then '1-10'
when avgMeditation > 10 and avgMeditation <= 20 then '11-20'
when avgMeditation > 20 and avgMeditation <= 30 then '21-30'
when avgMeditation > 30 and avgMeditation <= 40 then '31-40'
when avgMeditation > 40 and avgMeditation <= 50 then '41-50'
when avgMeditation > 50 and avgMeditation <= 60 then '51-60'
when avgMeditation > 60 and avgMeditation <= 70 then '61-70'
when avgMeditation > 70 and avgMeditation <= 80 then '71-80'
@recursivecodes
recursivecodes / create_game_materialized_view.sql
Created February 23, 2022 18:45
create_game_materialized_view.sql
create materialized view mv_game_details
build immediate
refresh fast on commit
as
select
g.rowid as "rowid",
g.id as "id",
g.match.utcStartSeconds as utcStartSeconds,
g.match.utcEndSeconds as utcEndSeconds,
g.match.map as map,
@recursivecodes
recursivecodes / Game.java
Created February 23, 2022 18:45
Game.java
@Entity
@AllArgsConstructor(access = AccessLevel.PACKAGE)
@NoArgsConstructor
@Data
@EqualsAndHashCode
public class Game {
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
private String match;
@recursivecodes
recursivecodes / game.sql
Created February 23, 2022 18:45
game.sql
select
g.match.utcStartSeconds as matchStart,
g.match.utcEndSeconds as matchEnd,
g.match.playerStats.kills as kills,
g.match.playerStats.deaths as deaths
from game g
order by created_on desc;