Skip to content

Instantly share code, notes, and snippets.

@vnnw
vnnw / snappy.go
Created November 3, 2020 10:05 — forked from miguelmota/snappy.go
Golang snappy encode and decode example
package main
import (
"fmt"
"log"
"github.com/golang/snappy"
)
func main() {
@vnnw
vnnw / dbt_plugin.py
Created November 8, 2019 08:01 — forked from nave91/dbt_plugin.py
Airflow plugin to create a dbt operator
# MIT License
# Copyright (c) 2019 Bellhops Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@vnnw
vnnw / dag.py
Created November 8, 2019 08:01 — forked from adamhaney/dag.py
DBT Airflow DAG with model/graph introspection
from datetime import datetime, timedelta
import networkx as nx
from airflow import DAG
from airflow.operators import BashOperator, SubDagOperator
start_date = datetime(year=2017, month=6, day=13, hour=19, minute=0)
schedule_interval = '0 * * * 1-5'
default_args = {
@vnnw
vnnw / dask_scylla_hive.py
Created March 20, 2019 13:45 — forked from ultrabug/dask_scylla_hive.py
Blog post: Evaluating ScyllaDB for production 2/2
#!/usr/bin/env python3.5
from time import time
import dask.dataframe as dd
import pandas as pd
from cassandra.cluster import Cluster
from cassandra.concurrent import execute_concurrent
from cassandra.policies import ConstantReconnectionPolicy
@vnnw
vnnw / pandas_dbms.py
Created November 5, 2017 10:09 — forked from catawbasam/pandas_dbms.py
Python PANDAS : load and save Dataframes to sqlite, MySQL, Oracle, Postgres
# -*- coding: utf-8 -*-
"""
LICENSE: BSD (same as pandas)
example use of pandas with oracle mysql postgresql sqlite
- updated 9/18/2012 with better column name handling; couple of bug fixes.
- used ~20 times for various ETL jobs. Mostly MySQL, but some Oracle.
to do:
save/restore index (how to check table existence? just do select count(*)?),
finish odbc,
@vnnw
vnnw / gist:2c0e5961d130130aa6e853186771003b
Created September 28, 2017 15:10 — forked from davecoutts/gist:b33a4d9447e470c0af46
Install Greenplum 4.3.2.0 on Centos 6.5 and run in two segment single node mode
su - root
# gpinitsystem fails to change the postgresql.conf port setting without ed
yum install ed unzip -y
groupadd -g 8000 gpadmin
useradd -m -s /bin/bash -d /home/gpadmin -g gpadmin -u 8000 gpadmin
passwd gpadmin
mkdir -p /data/master
@vnnw
vnnw / setup-taiga-centos.sh
Created March 19, 2017 04:13 — forked from sink66/setup-taiga-centos.sh
Taiga.io minimum install & run commands / CentOS7.2
#!/bin/bash
# How to use
# 1. Replace the "YOURIP" to yourIP
#sed -i -e 's/YOURIP/192.168.x.x/g' setup-taiga-centos.sh
# 2. Run at the root
#source setup-taiga-centos.sh
@vnnw
vnnw / tf_serving.sh
Created February 21, 2017 15:32 — forked from jarutis/tf_serving.sh
Install Tensorflow Serving on Centos 7 (CPU)
sudo su
# Java
yum -y install java-1.8.0-openjdk-devel
# Build Esentials (minimal)
yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils
# Extra Packages for Enterprise Linux (EPEL) (for pip, zeromq3)
yum -y install epel-release
@vnnw
vnnw / url_patterns.py
Created December 27, 2016 12:02 — forked from c4urself/url_patterns.py
URL Patterns with Optional Arguments
(r'^articles/(?P<year>\d{4}/?$, 'main.views.year'),
# When a use case comes up that a month needs to be involved as
# well, you add an argument in your regex:
(r'^articles/(?P<year>\d{4}/(?P<month>\d{2})/?$, 'main.views.year_month'),
# That works fine, unless of course you want to show something
# different for just the year, in which case the following case can be
# used, making separate views based on the arguments as djangoproject