Skip to content

Instantly share code, notes, and snippets.

View TysonJouglet's full-sized avatar

Tyson Jouglet TysonJouglet

  • Huntsville, AL
View GitHub Profile
create table aoc_rucksack(
rucksack varchar2(255) primary key
) inmemory;
create table aoc_item_priorities(
item char(1) primary key,
priority number
) inmemory;
insert into aoc_item_priorities(item, priority)
@TysonJouglet
TysonJouglet / aoc.sql
Last active December 2, 2022 22:51
Helper package for getting advent of code input.
create or replace package aoc
as
-- A new Advent of Code session value is needed. Please do the following:
-- 1) Log into your account at https://adventofcode.com
-- 2) Open dev tools and view page cookies
-- 3) Look at the session cookie and copy the value
-- 4) Replace "<your session>" with the newly copied value
c_session constant varchar2(32767) := '<your session>';
@TysonJouglet
TysonJouglet / EGtW_Fighter-Echo-Knight.js
Last active May 5, 2020 14:36
An MPMB import for the Echo Knight FIghter subclass
var iFileName = "EGtW_Fighter-Echo-Knight.js";
RequiredSheetVersion(13);
SourceList["EGtW"] = {
name : "Explorer’s Guide to Wildemount",
abbreviation : "EGtW",
group : "Primary Sources",
url : "https://dnd.wizards.com/products/wildemount",
date : "2020/03/17"
};
@TysonJouglet
TysonJouglet / background-image.css
Created November 14, 2019 16:45
Add background image to all APEX pages
/*Assumes APEX 5 + Universal Theme*/
.t-Body-content{
background-image: linear-gradient(#e66465, #9198e5);
/*
Instead of generating a gradient, it is possible to point to a specific file
url("path/to/my/image.svg")
*/
}
-- Exact interface is required by Oracle Text
create or replace procedure employee_search_datastore(
rid in rowid,
tlob in out nocopy varchar2
)
is
l_row emp%rowtype;
begin
select *
into l_row
@TysonJouglet
TysonJouglet / assert.sql
Created April 28, 2019 01:23
assert procedure for pl/sql
create or replace procedure assert (
p_condition in boolean,
p_message in varchar2
)
is
begin
if not p_condition
or p_condition is null
then
raise_application_error(-20001, p_message);
@TysonJouglet
TysonJouglet / is_valid_user.sql
Last active December 10, 2018 18:27
Test an APEX user and automatically convert plain text passwords into hashed passwords
create or replace function is_valid_user(
p_username varchar2,
p_password varchar2
)
return boolean
as
-- constants for different passwords (also very helpful if you change how you hash user passwords in the future)
C_PLAIN_TEXT constant varchar2(10) := 'VER1';
C_APEX_HASH constant varchar2(10) := 'VER2';
C_SALT constant varchar2(20) := 'c923kXm1027cnxslaH8S';
@TysonJouglet
TysonJouglet / Oracle-APEX-Previous-Page-Process.sql
Last active July 21, 2018 23:57
A generic process for automatically maintaining the previous page. It assumes the creation of two application items, G_PREV_PAGE_ID, G_CURR_PAGE_ID
-- this is an application process that runs onload of every page. Optionally this can be adjusted to not use the bind variable
-- references and added into an application initialize database session code
-- avoid MODAL and POPUP pages from updating previous page. A custom back item can be created for abnormal workflows requireing modals/popups
if apex_page.get_page_mode(:APP_ID, :APP_PAGE_ID) = 'NORMAL' then
if :G_CURR_PAGE_ID != :APP_PAGE_ID then -- if the page has changed
:G_PREV_PAGE_ID := :G_CURR_PAGE_ID;
end if;
:G_CURR_PAGE_ID := :APP_PAGE_ID;
end if;
@TysonJouglet
TysonJouglet / capital_B_dangit
Last active September 1, 2016 15:10
In light of discovering WordPress's capital_P_dangit. I present you the SkillBuilders version in PL/SQL...
create or replace function capital_B_dangit(
p_text varchar2
)
return varchar2
as
begin
return replace(p_text,'Skillbuilders','SkillBuilders');
end capital_B_dangit;
@media only screen /* Only smartphones */
and (min-device-width : 320px) /* in portrait or landscape mode */
and (max-device-width : 480px) {
.text-resize-report { /* Report Rows*/
font-size: xx-small;
}
.text-resize-report li.ui-li-divider{ /* Report header*/
font-size: xx-small;
}
}