This file contains 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
var WebSocketServer = require('ws').Server | |
, wss = new WebSocketServer({ port: 8080 }); | |
wss.broadcast = function broadcast(data) { | |
wss.clients.forEach(function each(client) { | |
client.send(JSON.stringify(data)); | |
}); | |
}; | |
var kafka = require('kafka-node'), |
This file contains 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
# Start Prometheus node-exporter | |
docker run -d \ | |
--net="host" \ | |
--pid="host" \ | |
-v "/proc:/host/proc:ro" \ | |
-v "/proc:/host/sys:ro" \ | |
--restart always \ | |
--name node-exporter \ | |
quay.io/prometheus/node-exporter:v0.16.0 \ | |
--path.procfs /host/proc \ |
This file contains 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
resource "aws_lb_listener" "monitoring" { | |
load_balancer_arn = "${aws_lb.monitoring.arn}" | |
port = "${var.alb_listener_port}" | |
protocol = "HTTPS" | |
certificate_arn = "${aws_iam_server_certificate.cert.arn}" | |
default_action { | |
type = "fixed-response" | |
fixed_response { |
This file contains 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
d=2016-08-17 | |
while [ "$d" != 2017-03-17 ]; do | |
d=$(date -I -d "$d + 1 month") | |
git checkout "master@{$d 00:00:00}" | |
plato -r -d /tmp/report -D $(date -d "$d 00:00:00" +"%s") app/ | |
done |
This file contains 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
# See rails source: | |
# https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/caching/pages.rb | |
# | |
# Turn on caching in development, by changing this line to true in config/environments/development.rb: | |
# | |
# config.action_controller.perform_caching = true | |
# | |
# Then run: | |
# | |
# bundle exec rake pages:cache |
This file contains 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
CONNECTION = Fog::Storage.new({ | |
:provider => 'AWS', | |
:aws_access_key_id => S3_STREAMING_BUCKET[:key], | |
:aws_secret_access_key => S3_STREAMING_BUCKET[:secret], | |
:region => S3_STREAMING_BUCKET[:region] | |
}) | |
S3 = CONNECTION.directories.get(S3_STREAMING_BUCKET[:bucket]) | |
S3.files.each do |file| |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/> | |
<script src="http://cmx.io/v/0.1/cmx.js"></script> | |
<body> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> | |
<tspan x="0" y="0em">Comix Sample</tspan> | |
</label> | |
<actor t="translate(131,49)" pose="-11,9|-5,117|-11,99|-11,89|-11,79|-11,59|-16,34|-21,9|-6,34|-1,9|-18,79|-18,59|-6,79|-1,59"> |
This file contains 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
require 'rspec' | |
require 'json' | |
require 'active_support/all' | |
require 'pry' | |
def input | |
[ | |
{lastmodificationdate:"2012-11-16",userproject:'FCBIZ',totalcost:10}, | |
{lastmodificationdate:"2012-11-16",userproject:'LMS',totalcost:20}, | |
{lastmodificationdate:"2012-11-16",userproject:'NetEngine',totalcost:52}, |
This file contains 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
FROM library/java:8-jre | |
ENV NODE_VERSION 4.2.0 | |
ENV NVM_DIR /usr/local/nvm | |
ENV DISPLAY :10 | |
ENV DEBIAN_FRONTEND noninteractive | |
# Replace shell with bash so we can source files | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh |
This file contains 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
var kafkaHost="kafka.example.com:2181" | |
var kafka = require('kafka-node'), | |
Producer = kafka.Producer, | |
Consumer = kafka.Consumer, | |
client = new kafka.Client(kafkaHost, "default_topic"), | |
consumer = new Consumer( | |
client, | |
[ |
NewerOlder