Skip to content

Instantly share code, notes, and snippets.

@cprieto
cprieto / custom.css
Last active July 29, 2018 20:07
Custom CSS for OCaml Jupyter kernel
/* BASICS */
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
color: black;
direction: ltr;
}
@cprieto
cprieto / populate_fact_keyword.sql
Last active May 2, 2018 16:53 — forked from obedespinoza/populate_fact_keyword.sql
This is the data population for the first prototype
BEGIN TRANSACTION;
INSERT INTO poc_dw.campaign_types (name) VALUES ('NONE');
INSERT INTO poc_dw.campaign_types (name) VALUES ('OTHER');
INSERT INTO poc_dw.campaign_types (name) VALUES ('MOBILE NEW FEED');
INSERT INTO poc_dw.campaign_types (name) VALUES ('DESKTOP NEW FEED');
INSERT INTO poc_dw.campaign_types (name) VALUES ('RIGHT SIDE HAND');
INSERT INTO poc_dw.campaign_types (name) VALUES ('SITE LINK');
INSERT INTO poc_dw.campaign_types (name) VALUES ('ACQUISITION');
INSERT INTO poc_dw.campaign_types (name) VALUES ('QUOTES');
INSERT INTO poc_dw.campaign_types (name) VALUES ('CONTENT');

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 / gist:4011791
Created November 4, 2012 12:54
Capitulo 2 - Delegados, Eventos, Heap and Stack, Tipos por Valor y Referencia

Capitulo 2

Lenguaje - Delegados

Es sumamente dificil que uno vea la importancia de los delegados inmediatamente cuando se comienza a aprender C#, recuerdo que la primera vez que los vi y lei sobre ellos pense que habia comprendido como funcionaban y no podia ver el porque eran tan interesantes o importantes, o bueno, ver la razon de su existencia.

Como menciona el capitulo, un delegado no es nada mas que un nivel de abstracion hacia una operacion algo que es similar a un puntero hacia una funcion en C , sin embargo van un poco mas alla, tomare en cuenta o por sentado que conoces las implicaciones y usos de un puntero a una funcion en C, si no, quizas refrescar el concepto te ayude Pointer to functions y nunca puede faltar el link de Wikipedia Function pointer.

Sin embargo, el concepto de un puntero a funcio

@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