Skip to content

Instantly share code, notes, and snippets.

this is a test
@dwl285
dwl285 / events_cleaned.sqlx
Last active March 16, 2020 16:04
Sessionisation from Looker to Dataform
config {
type: "view"
}
select distinct
timestamp,
user_id,
name as event_name,
is as event_id
from
@dwl285
dwl285 / main.py
Created November 1, 2019 15:27
Sending data from BigQuery to Intercom using Google Cloud Functions
import requests
from google.cloud import bigquery
# Intercom API access header
headers = {
'Authorization': 'Bearer access-token',
'Accept': 'application/json',
'Content-Type': 'application/json',
}
app.controller('MainController', ['$scope', 'places', function($scope, places) {
$scope.mapCenter = { lat: 40.741934, lng: -74.004897, zoom: 17 };
places.success(function(data) {
$scope.geodata = data;
});
$scope.mapMarkers = geodataToMarkers($scope.geodata);
}]);
app.factory('places', ['$http', function($http) {
return $http.jsonp('https://en.wikipedia.org/w/api.php?action=query&list=geosearch&gsradius=5000&gscoord=40.741934%7C-74.004897&gslimit=30&format=json&callback=JSON_CALLBACK')
.success(function(data) {
return data;
})
.error(function(data) {
return data;
});
}]);