Skip to content

Instantly share code, notes, and snippets.

View ernestoongaro's full-sized avatar

Ernesto Ongaro ernestoongaro

  • dbt Labs
  • Dublin, Ireland
View GitHub Profile
package routines;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import sun.misc.BASE64Encoder;
public class hashingUtils {
#!/bin/bash
# Copyright (c) 2016. TIBCO Software Inc.
# This file is subject to the license terms contained
# in the license file that is distributed with this file.
# version: 6.3.0-v1.0.4
# This script sets up and runs JasperReports Server on container start.
# Default "run" command, set in Dockerfile, executes run_jasperserver.
# If webapps/jasperserver-pro does not exist, run_jasperserver
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
CLIENT_ID='YOURS'
CLIENT_SECRET='YOURS'
END_POINT=https://YOURS:19999/api/3.0
LOOK_ID=12
which jq
if [ $status -gt 0 ]
then
echo "This utility requires the jq command line utility to parse JSON data. Find more information here: https://stedolan.github.io/jq/"
echo "On a mac with the brew utility installed, you should be able to install jq with the command \"brew install jq\"."
?dynamic_fields=[{"table_calculation":"rank","label":"rank","expression":"rank(${order_items.count},${order_items.count})","value_format":null,"value_format_name":null,"_kind_hint":"measure","_type_hint":"number"},{"table_calculation":"rank_this_month","label":"rank (this month)","expression":"pivot_index(${rank},1)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"rank_last_month","label":"rank (last month)","expression":"pivot_index(${rank},2)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"rank_last_year","label":"rank (last year)","expression":"pivot_index(${rank},3)","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure","_type_hint":"number"},{"table_calculation":"month_over_month_change","label":"month over month change","expression":"${rank_last_month} - ${rank_this_month}","value_format":null,"value_format_name":null,"_kind_hint":"supermeasure",
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"class":"806"},"geometry":{"type":"GeometryCollection","geometries":[{"type":"Polygon","coordinates":[[[16.997110422869135,60.79457447678141],[16.998269112081275,60.79482533259329],[17.022340000822286,60.80097737392255],[17.11218656779418,60.71680575854287],[17.117422240810846,60.71201853955253],[17.119853361006875,60.710814488418706],[17.12519879659224,60.709434075001965],[17.13510427084147,60.711267313260045],[17.141790181134926,60.71624563470729],[17.145625323768833,60.721325407062345],[17.148571503633683,60.76180782907883],[17.207895702086944,60.728782289223254],[17.220205780029683,60.72341895481281],[17.209495602097046,60.714274587236865],[17.196989983202982,60.70062471735477],[17.18198035586522,60.69474529410215],[17.167925616049565,60.69427358174364],[17.162271867023115,60.691677535802675],[17.16046752988998,60.69198528555882],[17.14530598514857,60.68689702228293],[17.14304828276375,60.68775393009436],[17.13842381974118,60.68486965
### This should only run if the session facts table is empty
view: session_facts_full_load {
derived_table: {
sql_trigger_value: select case when count(distinct partition_date) < 1 then "full re-build" else "daily incremental load" end from ${session_facts_pdt.SQL_TABLE_NAME} ;;
explore_source: ga_sessions {
column: id {}
column: partition_raw {}
column: keyword_count { field: trafficSource.keyword_count }
column: add_to__cart { field: hits_eventInfo.add_to__cart }
@ernestoongaro
ernestoongaro / trigger-dbt-cloud-job.ipynb
Last active February 28, 2024 12:19
Trigger dbt Cloud Job.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ernestoongaro
ernestoongaro / core.yml
Created September 15, 2021 15:12
core.yml
models:
- name: dim_customers
description: Customer dimensions table
columns:
- name: customer_key
description: Primary key on the customers table
tests:
- unique
- not_null
- name: region
@ernestoongaro
ernestoongaro / json.md
Last active September 20, 2021 11:44
json example

First run this in snowflake:

(
 src variant
)
AS SELECT parse_json(column1) as src
FROM values
('{ 
 "topleveldate" : "2017-04-28",