Skip to content

Instantly share code, notes, and snippets.

View even-wei's full-sized avatar
🐱
Working from home

Even Wei even-wei

🐱
Working from home
  • Taiwan
  • 16:15 (UTC +08:00)
View GitHub Profile
@even-wei
even-wei / generate_dim_dates.sql
Created April 8, 2025 03:11
A macro for generating dim_dates table in Snowflake
{% macro generate_dim_dates(schema_name=target.schema, table_name='dim_dates') %}
{% set create_table_query %}
CREATE OR REPLACE TABLE {{ schema_name }}.{{ table_name }} AS
WITH date_spine AS (
SELECT
DATEADD(day, seq4(), '1900-01-01') AS date_at
FROM TABLE(GENERATOR(ROWCOUNT => 55152))
WHERE date_at <= '2050-12-31'
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# default_runtime_name is the default runtime name to use.
- default_runtime_name = "${RUNTIME}"
+ default_runtime_name = "nvidia-container-runtime"
@even-wei
even-wei / primehub_tutorial.py
Last active January 6, 2022 00:27
A demo for integrating PrimeHub and Airflow
import logging as log
import datetime
from datetime import timedelta
import requests
import numpy as np
# The DAG object; we'll need this to instantiate a DAG
from airflow import DAG
from airflow.models import Variable