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 / build.gradle
Created February 28, 2022 18:03
build.gradle
implementation("io.micronaut.email:micronaut-email-javamail")
implementation("io.micronaut.email:micronaut-email-template")
implementation("io.micronaut.views:micronaut-views-thymeleaf")
@recursivecodes
recursivecodes / brain_to_the_cloud.ino
Created February 24, 2022 01:40
brain_to_the_cloud.ino
 void loop(){
mqttClient.loop();
if( brain.update() ) {
unsigned long now = millis();
StaticJsonDocument<250> doc;
char readingsJson[500];
uint8_t signalQuality = brain.readSignalQuality();
doc["signalStrength"] = map(signalQuality, 200, 1, 1, 100);
@recursivecodes
recursivecodes / brain_to_the_cloud.ino
Created February 24, 2022 01:40
brain_to_the_cloud.ino
 void loop(){
mqttClient.loop();
if( brain.update() ) {
unsigned long now = millis();
StaticJsonDocument<250> doc;
char readingsJson[500];
uint8_t signalQuality = brain.readSignalQuality();
doc["signalStrength"] = map(signalQuality, 200, 1, 1, 100);
@recursivecodes
recursivecodes / brain_to_the_cloud.ino
Last active March 15, 2022 18:57
brain_to_the_cloud.ino
EspMQTTClient mqttClient(
ssid,
password,
mqtt_url,
mqtt_username,
mqtt_password,
mqtt_client_id
);
@recursivecodes
recursivecodes / application.yml
Created February 23, 2022 18:45
application.yml
datasources:
default:
dialect: ORACLE
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
ocid: ${DB_OCID}
walletPassword: ${DB_WALLET_PASSWORD}
connection-factory-class-name: oracle.jdbc.pool.OracleDataSource
@recursivecodes
recursivecodes / vw_summary_by_attention_range.sql
Created February 23, 2022 18:45
vw_summary_by_attention_range.sql
select
case
when avgAttention >= 1 and avgAttention <= 10 then '1-10'
when avgAttention > 10 and avgAttention <= 20 then '11-20'
when avgAttention > 20 and avgAttention <= 30 then '21-30'
when avgAttention > 30 and avgAttention <= 40 then '31-40'
when avgAttention > 40 and avgAttention <= 50 then '41-50'
when avgAttention > 50 and avgAttention <= 60 then '51-60'
when avgAttention > 60 and avgAttention <= 70 then '61-70'
when avgAttention > 70 and avgAttention <= 80 then '71-80'
@recursivecodes
recursivecodes / bootstrap-oraclecloud.yml
Created February 23, 2022 18:45
bootstrap-oraclecloud.yml
oraclecloud:
vault:
config:
enabled: true
vaults:
- ocid: ${VAULT_OCID}
compartment-ocid: ${VAULT_COMPARTMENT_OCID}
use-instance-principal: true
region: US-PHOENIX-1
@recursivecodes
recursivecodes / summaryByRange.sql
Created February 23, 2022 18:45
summaryByRange.sql
create or replace function summaryByRange(factor in varchar2) return varchar2 sql_macro is
begin
return q'{
select
case
when summaryByRange.factor = 'meditation' and avgMeditation >= 1 and avgMeditation <= 10 then '1-10'
when summaryByRange.factor = 'meditation' and avgMeditation > 10 and avgMeditation <= 20 then '11-20'
when summaryByRange.factor = 'meditation' and avgMeditation > 20 and avgMeditation <= 30 then '21-30'
when summaryByRange.factor = 'meditation' and avgMeditation > 30 and avgMeditation <= 40 then '31-40'
when summaryByRange.factor = 'meditation' and avgMeditation > 40 and avgMeditation <= 50 then '41-50'
@recursivecodes
recursivecodes / GameRepository.java
Created February 23, 2022 18:45
GameRepository.java
@Query(
value = "select * from mv_game_details_with_brain where brainRecords > 0 order by matchStart desc",
nativeQuery = true,
countQuery = "select count(1) from mv_game_details_with_brain where brainRecords > 0"
)
Page<GameDetailDTO> listGameDetailsWithBrain(Pageable pageable);
@recursivecodes
recursivecodes / game.sql
Created February 23, 2022 18:45
game.sql
select *
from game g
order by created_on desc;