Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Putting out fires

Robert Ross bobbytables

🔥
Putting out fires
View GitHub Profile
View google-pubsub-example.rb
config = Rails.application.config.x.gcloud
pubsub = Google::Cloud::Pubsub.new project_id: config["project_id"], credentials: config["pubsub"]["keyfile"]
topic = pubsub.topic "incident-events"
sub = topic.subscription "hello-world"
subscriber = sub.listen do |received_message|
puts "sub 1"
puts received_message.message.data
received_message.acknowledge!
View prometheus-handler.yaml
apiVersion: config.istio.io/v1alpha2
kind: prometheus
metadata:
clusterName: ""
creationTimestamp: 2018-09-21T16:32:54Z
name: handler
namespace: istio-system
resourceVersion: "98310577"
selfLink: /apis/config.istio.io/v1alpha2/namespaces/istio-system/prometheuses/handler
uid: fd9e637a-bdbb-11e8-bdcf-0ec5bee14916
@bobbytables
bobbytables / main.go
Created Apr 26, 2018
A dumb little HTTP server to print headers easily using a tabwriter.
View main.go
package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
"text/tabwriter"
)
@bobbytables
bobbytables / configmap.yaml
Created Jan 12, 2018
Example of ConfigMaps and PodSpecs
View configmap.yaml
apiVersion: v1
data:
endpoint_deadline: 5s
listen_addr: "0.0.0.0"
listen_port: "50051"
metadata:
name: heimdall
namespace: default
@bobbytables
bobbytables / brace.yml
Created Oct 6, 2017
A sample file of what a brace rule set could look like
View brace.yml
version: 1
environment:
- name: LISTEN_ADDRESS
value: "localhost:8080"
usage: "This is the address that the application listens on"
- name: HEALTH_ADDRESS
value: "localhost:8080/healthz"
usage: "This is the endpoint for health checks performed by kubernetes"
- name: DATABASE_URL
value: "postgres://postgres:5432"
@bobbytables
bobbytables / build.sh
Created Feb 18, 2017
Protocol Buffer build script for multiple folders
View build.sh
#!/usr/bin/env bash
# This script is meant to build and compile every protocolbuffer for each
# service declared in this repository (as defined by sub-directories).
# It compiles using docker containers based on Namely's protoc image
# seen here: https://github.com/namely/docker-protoc
set -e
REPOPATH=${REPOPATH-/opt/protolangs}
CURRENT_BRANCH=${CIRCLE_BRANCH-"branch-not-available"}
View style1.proto
syntax = "proto3";
message Error {
string message = 1;
int32 error_code = 20;
}
message Application {
string id = 1;
string type = 2;
@bobbytables
bobbytables / json_generation_benches.rb
Last active Aug 29, 2015
Kartograph for JSON generation is fast.
View json_generation_benches.rb
require 'benchmark/ips'
require 'active_support/core_ext'
require 'jbuilder'
require 'kartograph'
require 'active_model_serializers'
require 'pry'
User = Struct.new(:id, :name, :email) do
def read_attribute_for_serialization(attribute)
send(attribute)
View gist:4cde7267b27256a31033
Hardware Overview:
Model Name: MacBook Pro
Model Identifier: MacBookPro11,3
Processor Name: Intel Core i7
Processor Speed: 2.6 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
@bobbytables
bobbytables / rdio_volume_hack.js
Created May 21, 2014
This makes the Rdio volume slider larger so the ticks of volume control change the setting slightly less.
View rdio_volume_hack.js
$('div.volume_wrapper').css({width: '150px'}).find('.Volume').css({width: '150px'})
You can’t perform that action at this time.