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
# Change this to reflect your installation directory | |
export __GIT_PROMPT_DIR=~/.oh-my-zsh/plugins/git-prompt | |
# Initialize colors. | |
autoload -U colors | |
colors | |
# Allow for functions in the prompt. | |
setopt PROMPT_SUBST |
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
BLACK="\[\033[0;30m\]" | |
BLUE="\[\033[0;34m\]" | |
BROWN="\[\033[0;33m\]" | |
CYAN="\[\033[0;36m\]" | |
GREEN="\[\033[0;32m\]" | |
GRAY="\[\033[0;37m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
LIGHT_GRAY="\[\033[1;37m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
PURPLE="\[\033[0;35m\]" |
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
# provided_signature = request.headers['X-Mandrill-Signature'] | |
provided_signature = '6jRJslRfT0Bx4N+X+6iQGEbpYp8=' | |
# 6jRJslRfT0Bx4N+X+6iQGEbpYp8= (as can be seen in the request bin) | |
# Params from the request bin formatted for Ruby. I've made all numbers | |
# strings here, but this doesn't work whether or not they're strings or numbers. | |
post_params = { | |
'mandrill_events' => [{ | |
"event" => "send", | |
"msg" => { |
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
# Sample values | |
url = "/api/suppliers" | |
params = {"trading_name": "Joe's Widgets", "registration_number": 123} | |
api_key = '123' # Your private API key | |
required_folds = 3 # The number of times to re-encrypt the data | |
# The calculation itself | |
import hmac | |
import hashlib | |
import base64 |
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
# Sample values | |
url = "/api/suppliers" | |
params = {"trading_name" => "Joe's Widgets", "registration_number" => 123} | |
api_key = '123' # Your private API key | |
required_folds = 3 # The number of times to re-encrypt the data | |
# The calculation itself | |
flattened_parameters = params.sort.map { |pair| "#{ pair[0] }=#{ pair[1] }" } | |
# ["registration_number=123", "trading_name=Joe's Widgets"] |
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 'time' | |
class QuackAnalysis | |
attr_reader :quacks | |
attr_accessor :distress_calls | |
def initialize(raw_quacks) | |
@quacks = sorted_quacks(raw_quacks) | |
@distress_calls = {} | |
identify_distress_calls |
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 'time' | |
class QuackAnalysis | |
attr_reader :quacks | |
attr_accessor :distress_calls | |
def initialize(raw_quacks) | |
@quacks = sorted_quacks(raw_quacks) | |
@distress_calls = {} | |
identify_distress_calls |