Skip to content

Instantly share code, notes, and snippets.

Example of report

The following reports are runing on consolidated data, the table revenue is an aggregate table of certain things I don't know.

Report name Aurora Redshift
Revenue of stuff 3.36s 4.1s
@cprieto
cprieto / sample.py
Created October 5, 2017 02:05
Problem with PyCharm inspection and :param types.
# It requires `pip install Flask Flask-Restful`
from flask import Flask
from flask_restful import Api
def init_app():
logger.debug('creating flask application')
app = Flask(__name__)
api = Api(app)
project (external_project)
cmake_minimum_required (VERSION 3.6)
set (SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output)
list (APPEND HELLO_SOURCES ${SOURCE_DIR}/hello.c)
include (ExternalProject)
#include <gtk/gtk.h>
static void activate (GtkApplication* app, gpointer user_data) {
GtkWidget *window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
gtk_widget_show_all (window);
}
int main (int argc, char **argv) {
function nvm --description "Fish nvm shim"
bass source ~/.nvm/nvm.sh ';' nvm $argv
end
@cprieto
cprieto / CMakeLists.txt
Last active March 28, 2017 00:17
CMake and Libraries - Part 1
cmake_minimum_required (VERSION 3.6)
project (hello VERSION 1.0)
set (LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/output)
add_subdirectory (greeter)
add_subdirectory (hello_app)
function which_term
switch(basename (ps -p (ps -p %self -o ppid=) -o args=))
case 'login*'
# This is a MacOSX terminal
echo (basename $TERM_PROGRAM .app)
case '*'
echo (basename (ps -p (ps -p %self -o ppid=) -o args=))
end
end
function fish_greeting
# We assume the name is the first element of the full name
switch (uname)
case Darwin
set full_user_name (id -P | cut -d: -f 8 | tr ' ' '\n')
case Linux
set full_user_name (getenv passwd $USER | cut -d: -f 5 | tr ' ' '\n')
case '*'
set full_user_name "Stranger"
function fish_greeting
echo ' ## . '
echo ' ## ## ## == '
echo ' ## ## ## ## === '
echo ' /""""""""""""""""\___/ === '
echo ' ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ '
echo ' \______ o __/ '
echo ' \ \ __/ '
echo ' \____\______/ '
end
@cprieto
cprieto / capture.cpp
Last active August 29, 2015 13:57
Sometimes closures are kind of different....
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
auto banana = 1;
auto func1 = [banana](int i) -> int { return i + banana; };
banana = 5;
auto result = func1(3);