Skip to content

Instantly share code, notes, and snippets.

Burak Emre Kabakcı buremba

View GitHub Profile
View gist:7c1e886abadcad352e96fff7b7f2fe41
<html>
<head></head>
<body>
{"status": ::CLOUDFLARE_ERROR_500S_BOX::, "message": "The server is not available, please try again later"}
</body>
</html>
@buremba
buremba / create-table.sql
Last active Dec 25, 2017
Raptor metadata queries
View create-table.sql
-- CREATE TABLE rakam_raptor.demo.demotable (_device_id VARCHAR, _time TIMESTAMP) WITH(temporal_column = '_time', bucketed_on=ARRAY['_device_id'], bucket_count = 10, distribution_name='test');
// Check if table exists
SELECT t.table_id, t.distribution_id, d.distribution_name, d.bucket_count, t.temporal_column_id, t.organization_enabled
FROM tables t
LEFT JOIN distributions d ON (t.distribution_id = d.distribution_id)
WHERE t.schema_name = ?
AND t.table_name = ?
// Check if distribution exists exists
View gist:2503f75095cfd1f10a35f075cdb300fb
<form rakam-event-form="collection_name">
<input type="text" name="attribute_name">
<input type="hidden" rakam-event-extra='{"another_field": 1}'>
<input type="submit" name="Send">
</form>
View gist:5962855ff1cd11482b8d951631f09a8b
import requests
import json
from pymongo import MongoClient
url = "[YOUR_RAKAM_API]/event/collect"
client = MongoClient()
client = MongoClient('localhost', 27017)
db = client.test_database
posts = db.posts
View text-classifier.js
var https = require('https');
var data = __REPLACE_JSON__;
var counter = data.length;
var result = {data: {}, error: {}};
data.forEach(function (keyword) {
var options = {
host: 'trends.google.com',
port: 443,
View gist:a2ad4c3b51794a2ab95a4434b837c7d4
FROM maven:3-jdk-8
MAINTAINER Burak Emre Kabakci "emre@rakam.io"
WORKDIR /var/app
RUN git clone https://github.com/rakam-io/rakam.git
RUN cd rakam && mvn install -DskipTests
RUN echo 'org.rakam=INFO\n\
io.netty=INFO' > log.properties
@buremba
buremba / gist:ada247b0ce837cfd3a81a92a98629f1d
Last active Oct 15, 2018
Rakam example config.properties for Postgresql deployment type
View gist:ada247b0ce837cfd3a81a92a98629f1d
store.adapter=postgresql
store.adapter.postgresql.url=jdbc:postgres://PG_HOST:5432/PG_DBNAME
store.adapter.postgresql.username=PG_USER
store.adapter.postgresql.password=PG_PASSWORD
plugin.user.enabled=true
event-explorer.enabled=true
custom-data-source.enabled=true
user.funnel-analysis.enabled=true
plugin.user.enable-user-mapping=true
event-stream=server
View gist:5e6d183f06ac524ac0633aeb0e5f257d
{ method: 'POST',
url: 'https://app.rakam.io//continuous-query/create',
httpVersion: 'HTTP/1.1',
headersSize: -1,
bodySize: -1,
cookies: [],
headers: [],
queryString: [],
comment: 'Creates a new continuous query for specified SQL query.\nRakam will process data in batches keep the result of query in-memory all the time.\nCompared to reports, continuous queries continuously aggregate the data on the fly and the result is always available either in-memory or disk.',
postData:
View gist:adcc8ac34e56642b2fd5539abae5f9dd
store.adapter=presto
presto.address=http://0.0.0.0:8080
presto.cold-storage-connector=rakam_raptor
presto.metastore.jdbc.url=jdbc:mysql://127.0.0.1:3306/presto
presto.metastore.jdbc.username=root
presto.metastore.jdbc.password=
presto.streaming.port=5466
event.store=kinesis
View gist:7e8e66d786cc2ec84b159a8e644c5c9e
import requests
import json
url = "[YOUR_RAKAM_API]/event/collect"
response = requests.post(url, data=json.dumps({"api":{"api_key":"YOUR_WRITE_KEY"},
"collection": "systemevent","properties":{ "_time": "2017-01-01T00:00:01", "_user": "userid"}}))
print(response.text)
You can’t perform that action at this time.