Skip to content

Instantly share code, notes, and snippets.

View seufagner's full-sized avatar
🏠
Working from home

Fagner Moura seufagner

🏠
Working from home
View GitHub Profile
@seufagner
seufagner / gist:f27c18171bcf8e7b08f49bc1fcc2a074
Last active July 7, 2017 21:05
Clickhouse useful links
* https://github.com/yandex/ClickHouse
### Drivers e conncetors
* https://github.com/yandex/clickhouse-jdbc
* https://github.com/DmitryBe/clickhouse-spark-connector
### UI
* https://github.com/smi2/tabix.ui
@seufagner
seufagner / gist:021ee8668d9fc490e265f9b600034cd9
Created January 6, 2017 19:04
format pandas float point
import pandas as pd
pd.set_option('display.float_format', lambda x: '%.3f' % x)
@seufagner
seufagner / gist:c06c6f52c590e7909667f78ebc96aa6d
Created January 6, 2017 19:03
show plots from matplotlib on zeppelin
%pyspark
import os
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import StringIO
import matplotlib
#!/bin/bash
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or a newly entered value.
@seufagner
seufagner / gist:395536fd8db6ee01d56d
Created February 27, 2016 21:06
Client to consume Localytics REST API
# The API enforces the following rate limits per API key on usage:
#
# Allows one simultaneous request
# 60 requests/minute
# 150 requests/hour
# 1000 requests/day
# The API will return a 429 response code when a rate limit is exceeded.
# You should reduce your rate of requests and retry throttled requests after the
# specified time.
@seufagner
seufagner / gist:ba2e7661bc2970d90546
Created February 27, 2016 21:03
SparkR on RStudio
Sys.setenv(SPARK_HOME = "/usr/local/spark-1.5.2/")
library(SparkR, lib.loc = c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib")))
@seufagner
seufagner / gist:2eb7c53d291d637733e0
Created February 26, 2016 17:34
Wrapper to consume data from Localytics REST API
# The API enforces the following rate limits per API key on usage:
#
# Allows one simultaneous request
# 60 requests/minute
# 150 requests/hour
# 1000 requests/day
# The API will return a 429 response code when a rate limit is exceeded.
# You should reduce your rate of requests and retry throttled requests after the
# specified time.
@seufagner
seufagner / pusher_wrapper.rb
Last active August 29, 2015 13:56
Pusher wrapper - use server and client gems
module Realtime
class PusherWrapper
attr_reader :socket
def initialize
Pusher.app_id = '<<app ID>>'
Pusher.key = '<<app key>>'
Pusher.secret = '<<secret key>>'