Skip to content

Instantly share code, notes, and snippets.

@nagoodman
nagoodman / ipo_day.ddl
Created September 16, 2020 14:37
Happy SNOW day!
* SnowSQL * v1.1.86
Type SQL statements or !help
SNOWACE#NGOODMAN_WH@HAPPY_IPO_DAY.PUBLIC>select * from table(happy_snow_day());
+---------------------------------------------------------------------------------+
| HAPPY_IPO_DAY_SEPTEMBER_16_2020 |
|---------------------------------------------------------------------------------|
| ███╗ ██╗██╗ ██╗███████╗███████╗ ███████╗███╗ ██╗ ██████╗ ██╗ ██╗ |
| ████╗ ██║╚██╗ ██╔╝██╔════╝██╔════╝██╗ ██╔════╝████╗ ██║██╔═══██╗██║ ██║ |
| ██╔██╗ ██║ ╚████╔╝ ███████╗█████╗ ╚═╝ ███████╗██╔██╗ ██║██║ ██║██║ █╗ ██║ |
| ██║╚██╗██║ ╚██╔╝ ╚════██║██╔══╝ ██╗ ╚════██║██║╚██╗██║██║ ██║██║███╗██║ |
Incident Identifier: 96155E3F-C661-4201-A594-45663B8FEA21
Beta Identifier: F569B13B-9483-4B6A-9226-2134410CB734
Hardware Model: iPhone6,1
Process: notch [245]
Path: /private/var/mobile/Containers/Bundle/Application/BA97211D-1520-472C-8FC1-CB8A7ED34BD7/notch.app/notch
Identifier: ch.notchte.app.testing
Version: 10311835 (1.0)
Beta: YES
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
@nagoodman
nagoodman / move_window_forward.js
Created January 7, 2012 02:31
move_window_forward.js
var foreignTableName = "KEY_WINDOWED";
var foreignTableSchema = "APPLIB";
var connection = Packages.java.sql.DriverManager.getConnection("jdbc:default:connection");
// TODO: should actually be select max(key) from target table
var newStartKeySQL = "select '[\"02/01/2007\"]' from (values(0))";
//Packages.java.lang.System.out.println("newStartKeySql:" + newStartKeySQL);
var stmt = connection.createStatement();
var rs = stmt.executeQuery(newStartKeySQL);
{
"axes": [
{
"name": "COLUMNS",
"levels": [
{
"dim": "Measures",
"level": "UnitSales.SUM"
},
{
0: jdbc:luciddb:> create table applib.tst1 ( d date)
. . . . . . . . > ;
No rows affected (0.306 seconds)
0: jdbc:luciddb:> insert into applib.tst1 values DATE'2012-01-06';
1 row affected (0.055 seconds)
0: jdbc:luciddb:> insert into applib.tst1 values DATE'2012-01-01';
1 row affected (0.13 seconds)
0: jdbc:luciddb:> insert into applib.tst1 values DATE'2012-01-03';
1 row affected (0.121 seconds)
0: jdbc:luciddb:> select * from applib.tst1 where d between DATE'2011-12-31' and DATE'2012-01-30';
@nagoodman
nagoodman / gist:1563401
Created January 5, 2012 02:28
sample sql luciddb
select 'Last 30 Days', sum(measure1)
from time t, fact f
where f.timeid = t.timeid
and
f.date between applib.add_days(current_date, -30) and current_date
UNION ALL
select 'Current Month', sum(measure1)
from time t, fact f
where f.timeid = t.timeid
and t.month = applib.extract_timestamp(current_timestamp, 'MONTH')+1
@nagoodman
nagoodman / s3bucketcreate
Created December 21, 2011 23:02
Create S3 Bucket using Knox
// Create S3 bucket
var s3client = dynAws.getKnoxClient("bucketname");
var httpReq = s3client.put("/", {});
httpReq.on('response', function (response) {
// 200 indicates successful bucket creation
console.log(response.statusCode);
}).end();