Skip to content

Instantly share code, notes, and snippets.

View phartenfeller's full-sized avatar

Philipp Hartenfeller phartenfeller

View GitHub Profile
@phartenfeller
phartenfeller / data_parser.sql
Created December 13, 2024 16:50
Demo on how to use the data parser package on excel sheets
-- list files:
select * from apex_application_temp_files
-- read sheets:
select * from table(
apex_data_parser.get_xlsx_worksheets(
p_content => (select BLOB_CONTENT from apex_application_temp_files where id = :P5_SELECTED_FILE )
)
)
where :P5_SELECTED_FILE is not null
1 week:
return q'!<a class="a-Button a-Button--popupLOV lov-clear" aria-label="1 week" title="1 week" href="javascript:$s('#CURRENT_ITEM_NAME#','!' || to_char(sysdate + 7, 'DD.MM.YYYY') || q'!');">!'
|| '<span class="">1w</span>'
|| '</a>';
Clear button:
return '<a class="a-Button a-Button--popupLOV lov-clear" aria-label="' || apex_lang.lang('Clear') || '" title="' || apex_lang.lang('Clear') || q'!" href="javascript:$s('#CURRENT_ITEM_NAME#','');">!'
|| '<span class="fa fa-close"></span>'
@phartenfeller
phartenfeller / query-23ai.sql
Last active May 4, 2024 09:13
Oracle APEX Navigation Menu Query
-- regexp_replace to remove badges with count (Customers [19])
with list_entries as (select regexp_replace(entry_text, ' \[&[A-Z]+\.\]') as title
, connect_by_root entry_image as icon
, regexp_substr( entry_target, '&APP_ID\.:([0-9]+):&', 1, 1, null, 1 ) as page_id
-- build path like Admin > Code Tables > Status
, substr( sys_connect_by_path( regexp_replace(entry_text, ' \[&[A-Z]+\.\]'), ' > ' ), 4 ) as path
from apex_application_list_entries
where application_id = :APP_ID
and list_name = 'Application Navigation'
and entry_target is not null
@phartenfeller
phartenfeller / Things I dislike about Garmin Venu 2.md
Last active January 8, 2024 14:16
I really love my watch just these things grind my gears. I know there is a successor so hopes of fixes are quite low :(

Notifications

  • Sync do not distrub mode with Android
  • If I get 7 messages from the same chat within 2 minutes don't vibrate for all of them
  • Support Android notification channels. WhatsApp chat message -> good, starting call or backup -> bad
  • Allow for silent notifiactions -> show on screen but dont vibrate

UI

  • Stress overview: allow swipe to left to go to yesterday
@phartenfeller
phartenfeller / da_plugin_example.sql
Created August 3, 2023 08:38
Oracle APEX Dynamic Action Plug-In PL/SQL example
function render_da(
p_dynamic_action apex_plugin.t_dynamic_action
, p_plugin apex_plugin.t_plugin
)
return apex_plugin.t_dynamic_action_render_result
as
l_return apex_plugin.t_dynamic_action_render_result;
l_action p_dynamic_action.attribute_01%type := p_dynamic_action.attribute_01;
l_storage_id p_dynamic_action.attribute_02%type := p_dynamic_action.attribute_02;
@phartenfeller
phartenfeller / gh-navbar-link-tampermonkey.js
Last active April 25, 2023 06:40
Violentmonkey script to add custom links to the GitHub navbar
@phartenfeller
phartenfeller / iso690-note-de.csl
Last active March 30, 2022 19:00
My customized Zotero style for DIN ISO 690 | original author Jan Drees
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="de-DE">
<info>
<title>ISO-690 (note, Deutsch)</title>
<id>http://www.zotero.org/styles/iso690-note-de</id>
<link href="http://www.zotero.org/styles/iso690-note-de" rel="self" />
<link href="http://www.zotero.org/styles/iso690-note-en" rel="template" />
<link href="http://www.iso.org/iso/catalogue_detail.htm?csnumber=43320" rel="documentation" />
<author>
<name>Jan Drees</name>
@phartenfeller
phartenfeller / toMatchIgnoreWhitespace.js
Created August 8, 2020 11:39
Jest custom matcher that ignores whitespace and new lines
// To use:
// Put `<rootDir>/path/to/toMatchIgnoreWhitespace.js` in your Jest config under setupFiles
// Call it in your tests like this:
// expect(received).toMatchIgnoreWhitespace(expected);
// Modified version of: https://gist.github.com/cassidoo/c726872858ce14e793a26619bd6a358f#file-customwhitespacematcher-js-L2
const { diffStringsUnified } = require('jest-diff');
const {
@phartenfeller
phartenfeller / Oracle Instant Client on Debian or Ubuntu
Last active October 2, 2024 17:21
Install an oracle instant client on a Debian or Ubuntu linux
apt-get install -y libaio1 alien
# Change version based on https://www.oracle.com/de/database/technologies/instant-client/linux-x86-64-downloads.html
# Example alternative: http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.5-basiclite-19.5.0.0.0-1.x86_64.rpm
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm
sudo alien -i --scripts oracle-instantclient*.rpm
rm -f oracle-instantclient*.rpm
# Optionally install SQLPlus
wget http://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/getPackage/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
sudo alien -i --scripts oracle-instantclient*.rpm
@phartenfeller
phartenfeller / patch-chronicle.sh
Created February 23, 2020 09:21
Script to restart and patch a chronicle server
/opt/cronicle/bin/control.sh stop
/opt/cronicle/bin/control.sh upgrade
/opt/cronicle/bin/control.sh start