Skip to content

Instantly share code, notes, and snippets.

View agilejon's full-sized avatar

Jon Dokulil agilejon

  • Cincinnati, OH
View GitHub Profile

Backpacking 101

affordable, light weight, comfortable - pick two.

Backpacking CAN be super expensive but it doesn't have to be. If it's your first time ever then consider renting or borrow from your friends or family.

Equipment

  • Backpack
@agilejon
agilejon / SnsMessage.cs
Created August 1, 2014 00:22
C# representation of an SNS message
/// <summary>
/// This is the C# representation of an SNS message. Its property names should not be modified unless AWS changes their spec.
/// </summary>
public sealed class SnsMessage
{
#region Properties that apply to both Subscription Confirmation and Notification messages
public string Message { get; set; }
public abstract class BifrostCommand<TArgs, TResult> : Command<TResult>
{
private readonly TArgs _arguments;
private readonly string _path;
public BifrostCommand(GroupKey isolationKey, TArgs arguments, string servicePath)
: base(isolationKey, TimeSpan.FromMilliseconds(15000)) // TODO make a constant available?
{
_arguments = arguments;
_path = servicePath;
public class Consumer {
private IModel _model;
private QueueingBasicConsumer _queue;
public Consumer(IConnection conn, string queueName) {
_model = conn.CreateModel();
_model.BasicQos(0, 50, false); // setting a per-channel prefetch can help with your overall throughput. See
// http://www.rabbitmq.com/blog/2012/04/25/rabbitmq-performance-measurements-part-2/
// for more info.
public class Publisher {
private IModel _model;
public Publisher(IConnection conn, string queueName) {
_model = conn.CreateModel();
// it's safe to declare queues that already exist as long as their properties are identical
// this runs on initialization every time - that will ensure all of your queues exist on app startup
model.QueueDeclare(queueName, true, false, false, null);
public void InitializeRabbitConnection()
{
ConnectionFactory = new ConnectionFactory()
{
HostName = "localhost",
Port = 5672,
UserName = "myapp",
Password = "password",
RequestedHeartbeat = 4, // heartbeat is what lets your code detect problems communicating with
// the RabbitMQ server. A heartbeat of 4 will cause the server to send
private void OnAppStartup()
{
ConnectionFactory = new ConnectionFactory()
{
HostName = "localhost",
Port = 5672,
UserName = "myapp",
Password = "password",
RequestedHeartbeat = 4, // heartbeat is what lets your code detect problems communicating with
// the RabbitMQ server. A heartbeat of 4 will cause the server to send
var solr = SolrProxy.GetConnection<IndexedClip>();
var field = new SolrQueryByField("d_OFF FORM", "Pro");
var options = new QueryOptions {
Facet = new FacetParameters { Queries = new[] {
new SolrFacetQuery(new SolrQueryByRange<int>("dist", 0, 3)),
...
new SolrFacetQuery(new SolrQueryByRange<string>("dist", "10", "*"))
} }
};
var results = solr.Query(field, options);
<script type="text/javascript">
var _sf_async_config={uid:@uid,domain:@domain,useCanonical:true};
(function(){
function loadChartbeat() {
window._sf_endpt=(new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src', '//static.chartbeat.com/js/chartbeat.js');
document.body.appendChild(e);
Jons-MacBook-Air-2:gitstats jondokulil$ netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
default utun0 UCS 24 0 utun0
default 10.0.1.1 UGScI 9 0 en0
10.0.1/24 link#8 UCS 0 0 utun0
10.0.1.1 b8:8d:12:57:f4:44 UHLSr 6 10 en0
10.0.1.108 127.0.0.1 UHS 0 0 lo0