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
class EnumDeliveryType < ::Protobuf::Enum | |
define :STANDARD, 1 | |
define :PRIORITY, 2 | |
define :NEXT_DAY, 3 | |
define :OVERNIGHT, 4 | |
end | |
# # # # # # # # # # # # # PART 1 # # # # # # # # # # # # # | |
## |
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
Thread.new do | |
trap(:TRAP) do | |
::Thread.list.each do |thread| | |
puts <<-THREAD_TRACE | |
#{thread.inspect}: | |
#{thread.backtrace.try(:join, $INPUT_RECORD_SEPARATOR)}" | |
THREAD_TRACE | |
end | |
end | |
end |
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
package main | |
import ( | |
"bytes" | |
"strconv" | |
) | |
//// | |
// Query Builder | |
// |
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 = nil | |
NATS.start(:servers => ['nats://198.199.103.139:4222']) do | |
start = Time.now | |
NATS.subscribe('demo', :queue => 'group.things') do |msg, reply| | |
puts "Hitting node 1 with #{msg}" | |
NATS.publish(reply, "Polo1!") | |
end | |
NATS.subscribe('demo', :queue => 'group.things') do |msg, reply| |
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 "nats/client" | |
def get_request | |
start = nil | |
NATS.start(:servers => ['nats://198.199.103.139:4222']) do | |
start = Time.now | |
NATS.subscribe('demo') do |msg, reply| | |
NATS.publish(reply, "Polo!") |
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
class BashQueue | |
FIFO_QUEUE = '/tmp/channel' | |
# Setup fifo queue called channel | |
def self.ensure_setup! | |
unless ::File.exist?(FIFO_QUEUE) | |
`mkfifo #{FIFO_QUEUE}` | |
end | |
end |
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
;;; dracula-theme.el --- Emacs 24 theme with a dark background. | |
;; Author: film42 | |
;; | |
;; Version: 0.1 | |
;; Package-Requires: ((emacs "24")) | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
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
#! /usr/bin/env bash | |
# Get xv6 working with OSX Yosemite | |
# Most things were here: https://doesnotscale.com/compiling-xv6-on-os-x-10-9/ | |
# You need homebrew installed to make this thing work | |
brew tap homebrew/versions && brew install gcc48 | |
brew deps qemu | xargs brew install | |
export PATH=/usr/local/bin:$PATH | |
export CC=/usr/local/bin/gcc-4.8 | |
brew install wget |
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
-module(erlish). | |
-export([init/0, manager/1, get/1, set/2, keys/0, del/1, expire/2]). | |
manager(State) -> | |
receive | |
{get, Key, Sender} -> | |
Value = case maps:is_key(Key, State) of | |
true -> | |
maps:get(Key, State); | |
_ -> |
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
$ film42@mbp ~/D/D/S/C/t/a/build (master)> | |
valgrind --leak-check=full --dsymutil=yes ./avl_tree_tests | |
==65466== Memcheck, a memory error detector | |
==65466== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==65466== Using Valgrind-3.11.0.SVN and LibVEX; rerun with -h for copyright info | |
==65466== Command: ./avl_tree_tests | |
==65466== | |
--65466-- run: /usr/bin/dsymutil "./avl_tree_tests" | |
Running test: Contains Tests | |
Malloc'd tree |