I hereby claim:
- I am th3james on github.
- I am th3james (https://keybase.io/th3james) on keybase.
- I have a public key ASBqlzaHAgmzGYcRHYURnr5RbHSvFOaGa3uS1QJl0R9r-wo
To claim this, I am signing this object:
// An attempt to have a struct with dependency which is a trait | |
// with a default constructor with provides the production dependency | |
// This approach uses `dyn` keyword which means the traits are checked at runtime | |
// | |
// Adapted from https://doc.rust-lang.org/book/ch15-05-interior-mutability.html | |
pub trait Messenger { | |
fn send(&self, msg: &str); | |
} | |
pub struct ConcreteMessenger; |
#!/usr/bin/env ruby | |
# Executes a given command on a given ecs cluster | |
# Usage: | |
# ./ecs_cluster_exec.rb cluster-name docker ps | |
def command_pipe(*commands) | |
commands.join(' | ') | |
end | |
def get_cluster_host_arns(cluster_name) |
I hereby claim:
To claim this, I am signing this object:
require 'json' | |
key_to_find = /.*thing-or-whatever.*/ | |
users = JSON.parse(`aws iam list-users`).fetch('Users') | |
usernames = users.map { |user| | |
user.fetch('UserName') | |
} | |
user_secret_keys = Hash[ |
tell application "iTerm" | |
activate | |
set term to (make new terminal) | |
tell term | |
set serverSession to (launch session "Default Session") | |
tell serverSession | |
set name to "server" |
# Shatter - Liz Phair | |
Open D tuning with a capo on first fret. | |
Tab relative to capo | |
## Intro p1 | |
d#|----------------------------------------| | |
A#|----------------------------------------| |
test(".save persists the model to the server and adds the ID to the attributes", function() { | |
var page, persistenceId, server; | |
// Create a fake server to block AJAX requests | |
server = sinon.fakeServer.create(); | |
// Upon receiving a request to '/pages', respond with an ID | |
persistenceId = 6; | |
server.respondWith(new RegExp("/pages"), JSON.stringify({ | |
id: persistenceId |
suite("Page"); | |
test(".addSection adds a section and saves the page", function() { | |
var page, pageSaveStub; | |
page = new Page({ | |
sections: [] | |
}); | |
// page.save would call the server, stub it with a successful query | |
pageSaveStub = sinon.stub(page, 'save', function(attributes, options) { |
suite('ReportView'); | |
test("Renders a given report's title", function() { | |
var report, view; | |
report = { | |
title: "My Lovely Report" | |
}; | |
view = new ReportView(report); | |
view.render(); |
suite("PickUserView"); | |
test('when clicking the close button, the view gets closed', function() { | |
var view, viewCloseSpy; | |
// The function we expect to be called on close | |
viewCloseSpy = sinon.spy(ChooseUserView.prototype, 'close'); | |
view = new ChooseUserView(); | |
view.render(); |