This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# User module to receive tweets | |
from recevie_tweets_pubsub import receive_tweets | |
import pandas | |
from bokeh.io import curdoc | |
from bokeh.models import ColumnDataSource | |
from bokeh.models import DatetimeTickFormatter | |
from bokeh.plotting import figure, output_file | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def publish(client, pubsub_topic, data_lines): | |
"""Publish to the given pubsub topic.""" | |
messages = [] | |
for line in data_lines: | |
messages.append({'data': line}) | |
body = {'messages': messages} | |
str_body = json.dumps(body) | |
data = base64.urlsafe_b64encode(bytearray(str_body, 'utf8')) | |
client.publish(topic=pubsub_topic, data=data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ... | |
import com.google.api.services.bigquery.model.TableFieldSchema; | |
import com.google.api.services.bigquery.model.TableRow; | |
import com.google.api.services.bigquery.model.TableSchema; | |
import com.google.api.services.bigquery.model.TimePartitioning; | |
import com.google.common.collect.ImmutableList; | |
import org.apache.beam.sdk.Pipeline; | |
import org.apache.beam.sdk.coders.Coder; | |
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script will avoid the effort of downloading each software one by one and then moving them to Applications folder. | |
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; | |
# Install nec | |
brew install wget |
NewerOlder