Skip to content

Instantly share code, notes, and snippets.

View casajarm's full-sized avatar

Greg Jarmiolowski casajarm

View GitHub Profile
@casajarm
casajarm / ffmpeg_concatenate.js
Last active February 24, 2021 22:27
Using FFMPEG to concatenate files on Google Cloud Functions via NodeJS .. send it array of filenames and the extension type and it returns a promise that resolves to the final file with full path
const os = require("os");
const ffmpegPath = require("@ffmpeg-installer/ffmpeg").path;
const fluent_ffmpeg = require("fluent-ffmpeg");
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
const path = require('path');
fluent_ffmpeg.setFfprobePath(ffprobePath); //this was key for me on GCF
fluent_ffmpeg.setFfmpegPath(ffmpegPath);
/**
@casajarm
casajarm / photo_lat_long.sql
Last active March 3, 2020 18:07
Extract GPS Coordinates from JPG stored as BLOB in Oracle Database
SELECT extractvalue(value(exif), '//exifMetadata/GpsIfd/GPSLatitude'
, 'xmlns="http://xmlns.oracle.com/ord/meta/exif"') AS latitude
, extractvalue(value(exif), '//exifMetadata/GpsIfd/GPSLongitude'
, 'xmlns="http://xmlns.oracle.com/ord/meta/exif"') AS longitude
FROM photos
, TABLE((ordsys.ordimage.getmetadata(photo_image, 'EXIF'))) exif
WHERE photo_id = :ID /* optional filter */
@casajarm
casajarm / gist:59312930750f1627a0f570c24a7bd2d8
Created February 17, 2020 00:20
Oracle Apex function that can be used to look for the latest viewed application page across a set of pages for the given app and session. Used to dynamically branch to one of these pages.
create or replace function latest_page_viewed(p_page_list in varchar2
, p_app_id in number
, p_session_id in number)
-- p_page_list is expected set of pages in colon dilimited format eg '1000:1001:10002'
return number
is
l_latest_page number;
begin
select page_id