Skip to content

Instantly share code, notes, and snippets.

View tschf's full-sized avatar

tschf tschf

View GitHub Profile
@tschf
tschf / main.go
Created October 5, 2020 06:26
OCI compute listing example
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/common"
"github.com/oracle/oci-go-sdk/common/auth"
"github.com/oracle/oci-go-sdk/core"
)
@tschf
tschf / main.go
Last active October 5, 2020 08:11
OCI instance principal request
package main
import (
"context"
"fmt"
"github.com/oracle/oci-go-sdk/common"
"github.com/oracle/oci-go-sdk/common/auth"
"github.com/oracle/oci-go-sdk/identity"
)
@tschf
tschf / 1_chains.sql
Created October 1, 2020 11:10
array chains
declare
begin
for i in
1..3<b>,
7..10</b>
loop
dbms_output.put_line(i);
end loop;
end;
/
@tschf
tschf / gist:d5eb35ba39495e69a9990957dc2c4af3
Created January 12, 2018 02:30
.net ordering a list example
List<SystemVersion> installedVersions = new List<SystemVersion>();
installedVersions.Add(new SystemVersion("system17.1.123.1256"));
installedVersions.Add(new SystemVersion("system17.2.0.188.1159"));
installedVersions.Add(new SystemVersion("system4.2.123.1256"));
List<SystemVersion> sortedVersions =
installedVersions
.OrderByDescending(o=>o.BuildNumber.Major)
.ThenByDescending(o=>o.BuildNumber.Minor)
.ThenByDescending(o=>o.BuildNumber.MajorRevision)
@tschf
tschf / script.sql
Last active May 7, 2017 02:59
Oracle: case with a tuple (object)
create type ot_info is object (
a number,
b number,
c number,
map member function equals return raw
);
/
create type body ot_info as
@tschf
tschf / query.sql
Created September 2, 2016 23:10
SLK-581 Linkage in SQL
set sqlformat ansiconsole
--See: http://www.aihw.gov.au/WorkArea/DownloadAsset.aspx?id=60129551915
--http://meteor.aihw.gov.au/content/index.phtml/itemId/349510
with raw_data as (
select
upper('Smith') last,
upper('Nicholas') first,
to_date('29-01-1959', 'dd-mm-yyyy') dob,
'M' gender
from dual
@tschf
tschf / README.md
Created August 31, 2016 23:21
Atom fresh sessions

Atom has a config not in the UI: core.restorePreviousWindowsOnStart.

Set this to false in your config.cson file in order to start Atom in a blank state when you launch Atom.

$ /home/trent/node-v0.12.2-linux-x64/bin/node app.js dev 110
options { configFile: '/home/trent/apex-diff/config/config.json',
sqlcl: '/opt/sqlcl/bin/sql',
debug: true,
rebuildTempFile: false,
connections:
{ dev: 'dl_test/dl_test@localhost/xe',
prod: 'dl_prod/dl_prod@localhost/xe' } }
sql: { command: '%SQLCL% %CONNECTION% @%DIRECTORY%/%FILENAME% %PARAMS%',
files:
@tschf
tschf / download.sql
Created August 10, 2015 21:21
Download file with wpg_docload
declare
l_file files%rowtype;
begin
select *
into l_file
from files
where id = 261;
owa_util.mime_header(l_file.mime_type);
@tschf
tschf / ORDS.md
Last active August 29, 2015 14:20
Using SSH Connections for ORDS Admin

I set up the the SSH profile:

See: sshprofile.png

Then I can set up the connection by specifying the type as SSH, successfully:

See: ssh_connection_test.png

However, in the REST Admin, I don't get the SSH connection option: