This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
CI script to check: | |
1. Models have both a unique and not_null test. | |
2. Models have a description and columns (i.e. a schema.yml entry) | |
""" | |
import json | |
import logging | |
import os | |
import subprocess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.SparkConf | |
import org.apache.spark.sql.SparkSession | |
import org.apache.spark.sql.types._ | |
import org.slf4j.{Logger, LoggerFactory} | |
object Main { | |
val logger: Logger = LoggerFactory.getLogger(this.getClass) | |
private lazy val sparkConf: SparkConf = new SparkConf() | |
.setMaster("local[*]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
'''Script to autogenerate dbt commands for changed models against a chosen git branch, | |
with support for fully refreshing models with specific tags. | |
Usage: | |
$ python3 dbt_run_changed.py --target_branch master --target dev --commands [run, test] --full_refresh_tags [full_refresh] | |
Assume model1 and model2 are changed models and model2 is tagged with "full_refresh". The script will generate three dbt commands: | |
1. dbt run --target dev --model model2 --full-refresh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- models/example_model.sql | |
{{ config( | |
materialized='rollup', | |
rollups={ | |
"hourly": "date_trunc('hour', event_time)", | |
"daily": "date_trunc('day', event_time)" | |
}, | |
aggregates={ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE traversed (id, name, path, `left`, `right`) AS ( | |
SELECT id, | |
name, | |
CAST(JSON_ARRAY(id) AS JSON), | |
`left`, | |
`right` | |
FROM binary_tree | |
WHERE id = 1 | |
UNION | |
SELECT b.id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/relative/path/to/PrettierPHPFixer/File'; | |
return PhpCsFixer\Config::create() | |
->registerCustomFixers([ | |
(new PrettierPHPFixer()), | |
]) | |
->setRules([ | |
'Prettier/php' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return PhpCsFixer\Config::create() | |
->setRiskyAllowed(true) | |
->setRules([ | |
'@PSR2' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => | |
[ | |
'align_equals' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "index_hadoop", | |
"spec": { | |
"ioConfig": { | |
"type": "hadoop", | |
"inputSpec": { | |
"paths": "hdfs://analytics-hadoop/tmp/gsc-all.csv.gz", | |
"type": "static" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before usage make sure to have a working mail setup. | |
# If you are not sure what that means and you run Ubuntu just run "apt install mailutils" and | |
# choose following settings (be sure to replace example.com with your domain): | |
# General type of mail configuration?: Internet Site | |
# System mail name: example.com | |
# Root and postmaster mail recipient: username | |
# Other destinations to accept mail for: $myhostname, example.com, mail.example.com, localhost.example.com, localhost | |
# Force synchronous updates on mail queue?: No | |
# Local networks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You can call this script like this: | |
# $./volume.sh up | |
# $./volume.sh down | |
# $./volume.sh mute | |
function get_volume { | |
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1 | |
} |
NewerOlder