Skip to content

Instantly share code, notes, and snippets.

View estebgonza's full-sized avatar

Esteban estebgonza

View GitHub Profile
<template>
<div id="app">
<p>
Pending: {{ $store.state.getInfoPending }}
</p>
<p>
{{ $store.state.getInfoData }}
</p>
</div>
</template>
# this lives in superset_config.py
class AirbnbAuthRemoteUserView(AuthRemoteUserView):
def add_role_if_missing(self, sm, user_id, role_name):
found_role = sm.find_role(role_name)
session = sm.get_session
user = session.query(sm.user_model).get(user_id)
if found_role and found_role not in user.roles:
user.roles += [found_role]
session.commit()
@saeidzebardast
saeidzebardast / Enable CORS in Spark Java
Created March 8, 2016 10:30
Enable CORS in Spark Java to allow origins *
options("/*",
(request, response) -> {
String accessControlRequestHeaders = request
.headers("Access-Control-Request-Headers");
if (accessControlRequestHeaders != null) {
response.header("Access-Control-Allow-Headers",
accessControlRequestHeaders);
}
@samklr
samklr / install-proto.sh
Created April 20, 2015 08:19
Install Protobuf debian ...
#! /bin/bash
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
tar xzf protobuf-2.6.1.tar.gz
cd protobuf-2.6.1
sudo apt-get update
sudo apt-get install build-essential
sudo ./configure
sudo make
sudo make check
sudo make install