Skip to content

Instantly share code, notes, and snippets.

Cristian Prieto cprieto

Block or report user

Report or block cprieto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View some.ml
(* This is a code fragment in OCaml *)
match watever with
| (true, _) ->
match String.lowecase Path.GetExtension path with
| ".sln" | ".csproj" | ".fsproj" -> Path.GetFullPath path
_ -> failwith "Whatever"
View instructions.md

Write a simple server that sends a notification about every 2 seconds. To receive the notification, a client has to register with the server.

View spawn_ex1.ex
defmodule SpawnEx1 do
import :timer, only: [sleep: 1]
def greet(pid) do
send pid, {:ok, "I'm alive"}
exit(:dead)
end
def process_messages() do
receive do
View size.c
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stddef.h>
typedef int *ptr_int;
typedef struct unordered {
int a;
double b;
View this_fails_with_java_lang_NoClassDefFoundError.kt
package com.cprieto.samples
class ShortToStringConverterListener: ArrayInitBaseListener() {
private val builder = StringBuilder()
override fun enterInit(ctx: ArrayInitParser.InitContext?) {
builder.append("{")
}
override fun toString(): String {
@cprieto
cprieto / custom.css
Last active Jul 29, 2018
Custom CSS for OCaml Jupyter kernel
View custom.css
/* 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 — forked from obedespinoza/populate_fact_keyword.sql
This is the data population for the first prototype
View populate_fact_keyword.sql
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');
View example of report.md

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 Oct 5, 2017
Problem with PyCharm inspection and :param types.
View sample.py
# 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)
View CMakeLists.txt
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)
You can’t perform that action at this time.