Skip to content

Instantly share code, notes, and snippets.

View gphat's full-sized avatar

Cory G Watson gphat

View GitHub Profile
@gphat
gphat / gist:c9d22e1c0d3e0d2546d1
Created August 15, 2014 21:50
Cassandra Datadog JMX Config
instances:
- host: localhost
port: 7199
# user: username
# password: password
# name: cassandra_instance
# #trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled
# #trust_store_password: password
# #java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable
@gphat
gphat / gist:fd9517bef66cbc9468cd
Created August 15, 2014 22:06
Kafka Datadog JMX Config
instances:
- host: localhost
name: kafka_instance
port: 9999 # This is the JMX port on which Kafka exposes its metrics (usually 9999)
# user: username # If JMX authentication is enabled, set the username and the password here
# password: password
# #java_bin_path: /path/to/java #Optional, should be set if the agent cannot find your java executable
# #trust_store_path: /path/to/trustStore.jks # Optional, should be set if ssl is enabled
# #trust_store_password: password
package emp.util
import scala.math._
/**
* Helper for pagination.
*/
object Pagination {
/**
require 'rubygems'
require 'railsless-deploy'
# Your application name
set :application, "someapp"
# We're not deploying from a repo, since this is scala and we
# need to compile. Set SCM to none
set :scm, :none
# Our deploy is to copy the contents of…
I got into management for two reasons:
1. Money
2. To make the place _I_ wanted to work.
I'm so full of myself that I think the place that I want to work is the place that you want to work. I bet I'm right.
I'd like to outline my guide for making a good development shop. We'll cover all of these topics:
* How to find a good job.
=pod
=head1 Taming Search with Data::SearchEngine
Sooner or later it's going to happen: Someone will request a feature of your
application's search code. It might be gentle at first. A casual remark about
speed, functionality or scalability will meander into your bug tracker,
standup meeting or planning session. At first you will nod and file it away,
knowing that it takes a few requests for something to really stick. Pretty
soon a second, perhaps unrelated, request will arrive. Before you know it you'll
# Storm Multi-Language Support
## The ShellBolt
Support for multiple languages is implemented via the ShellBolt class. This
class implements the IBolt interfaces and contains the facilities for
executing a script or program via the shell using Java's ProcessBuilder class.
## The Wrapper Class
gphat@Corys-iMac ~/src/storm-starter (master) $ storm jar storm-starter-0.0.1-SNAPSHOT.jar storm.starter.WordCountTopology asshole.txt
Running: export STORM_JAR=storm-starter-0.0.1-SNAPSHOT.jar; java -client -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -cp /Users/gphat/src/storm/storm-0.5.4-SNAPSHOT.jar:/Users/gphat/src/storm/lib/clj-time-0.3.0.jar:/Users/gphat/src/storm/lib/clojure-1.2.0.jar:/Users/gphat/src/storm/lib/clojure-contrib-1.2.0.jar:/Users/gphat/src/storm/lib/clout-0.4.1.jar:/Users/gphat/src/storm/lib/commons-cli-1.2.jar:/Users/gphat/src/storm/lib/commons-codec-1.3.jar:/Users/gphat/src/storm/lib/commons-el-1.0.jar:/Users/gphat/src/storm/lib/commons-exec-1.1.jar:/Users/gphat/src/storm/lib/commons-fileupload-1.2.1.jar:/Users/gphat/src/storm/lib/commons-httpclient-3.0.1.jar:/Users/gphat/src/storm/lib/commons-io-1.4.jar:/Users/gphat/src/storm/lib/commons-lang-2.4.jar:/Users/gphat/src/storm/lib/commons-logging-1.0.4.jar:/Users/gphat/src/storm/lib/commons-logging-api-1.0.4.jar:/Users/gph
my $verifier = Data::Verifier->new(
profile => {
email => {
post_check => sub {
my $r = shift;
my $status = $r->get_value('status');
if(defined($status) && $status eq 'Publish now') {
return 0 unless defined($r->get_value('not_before_date_str');
}
return 1;
@gphat
gphat / kafka.pl
Created January 12, 2011 15:37 — forked from jshirley/kafka.pl
package Kafka::Client;
use Moose;
use Digest::CRC qw(crc32);
use IO::Socket;
my $PRODUCE_REQUEST_ID = 0;
has 'host' => (
is => 'ro',