Skip to content

Instantly share code, notes, and snippets.

Feature: API user adds credentials to an agile keychain
So that I can store my passwords
As an API user
I must be able to add credentials to the keychain
Scenario: Adding website credentials to the keychain
Given I have an initialised keychain
When I assign my credentials to a key in the keychain
Then that data should be stored in the keychain

Keybase proof

I hereby claim:

  • I am mlopes on github.
  • I am mlopes (https://keybase.io/mlopes) on keybase.
  • I have a public key whose fingerprint is 0F50 1723 91FB 6D17 9644 BB99 FA9E A8FB 66EA AA8E

To claim this, I am signing this object:

# Tell - The de-coupling allows me to write the example without having to write an example of the Keychain class
class EncryptionKey:
def __init__(self, keychain):
self.keychain = keychain
def decrypt(self, password):
if _decrypt(password):
self.keychain.unlock()
@mlopes
mlopes / gist:1852698
Created February 17, 2012 11:05
Convert wordpress plugin vipers quicktags youtube tags to octopress youtube tags
#!/usr/bin/perl
use strict;
my $script_name = $ARGV[0];
my $file_contents = "";
while(<>) {
if($_ =~ /\[youtube\](.*)\[\/youtube\]/) {
if($1 =~ /[\?&]v=([^&]+).*/) {
@mlopes
mlopes / gist:1852550
Created February 17, 2012 10:36
Convert wordpress style caption tags to octopress image tags
#!/usr/bin/perl
use strict;
my $script_name = $ARGV[0];
my $file_contents = "";
while(<>) {
if($_ =~ /\[caption.*/) {
my %imageData;
@mlopes
mlopes / globaltoc.rst
Created January 30, 2012 16:34
globaltoc.rst file generating an empty TOC