Skip to content

Instantly share code, notes, and snippets.

View rwdaigle's full-sized avatar

Ryan Daigle rwdaigle

View GitHub Profile

Keybase proof

I hereby claim:

  • I am rwdaigle on github.
  • I am rwdaigle (https://keybase.io/rwdaigle) on keybase.
  • I have a public key ASCYrBykbJWHXZSrKdsv3CEMS3UD6iETVRnX2Fn0mzROVgo

To claim this, I am signing this object:

@rwdaigle
rwdaigle / xmldsig.md
Created September 26, 2016 17:27 — forked from mrezentes/xmldsig.md
XML Signature Syntax and Processing

Spreedly uses the xmldsig library to perform the signing. To properly sign an xml request, enclose the entire xml request to be signed in xml_dsig template tags.

Nodes that should not be changed.

Do not modify the <wsse:Security> node. It must be formatted as given. This binary security token node will be generated on the server along with the timestamp.

Attributes that should not be changed.

Changes to the wsu:Id attribute of any node will cause signature failures.

class Array
def odds
odds = []
each_with_index do |val, index|
odds << val if index % 2 == 1
end
odds
end
end
@rwdaigle
rwdaigle / cashbackapp-export.md
Last active July 18, 2016 17:33 — forked from mrezentes/SFTP-batch-export.md
SFTP Batch Export

Export multiple payment methods in a single, asynchronous, batch call to an SFTP receiver endpoint.

Because the Visa file format is quite unwieldy, and requires encryption, we'll approach this in two phases. First we'll work on getting a test file exported w/ test payment methods and no encryption so you can confirm that your file template is working. Then, we'll add the gpg encryption required by Visa and have it use the production receiver.

1. Create test receiver

Export is part of Spreedly's PMD/receiver functionality, which allows you to send card data to non-gateway APIs. As such, export shares much of its terminology and functionality with deliver, the single-card and synchronous version of export.

First, create a test receiver that will let you specify any hostname (add the sftp auth in the protocol section):

@rwdaigle
rwdaigle / rails-bridge.md
Last active February 27, 2016 17:47
RailsBridge Triangle post-weekend help

RailsBridge Triangle

It's important to not lose the momentum you have from today - we've setup a chat room in Slack that will let you ask questions and stay in touch with everybody from today (including your TAs and organizers!) Here's how you join!

1. Join Triangle Devs

Join Slack by going to this site: https://triangle-devs-slack-inviter.herokuapp.com

Enter you email address and press "enter" to get an email invitation.

@rwdaigle
rwdaigle / elixir-directives.txt
Last active February 10, 2016 22:18
Why are there so many Elixir directives? Capture of discussion on #elixir-lang w/ Jose Valim and Chris McCord.
*Note: this conversation was santized only in that unrelated messages were removed from the stream*
[10:19] == rwdaigle [47b7ec4a@gateway/web/freenode/ip.71.183.236.74] has joined #elixir-lang
[10:22] <rwdaigle> chrismccord: we chatted a bit on twitter about this the other day, so I wrote up my thoughts on there being too many Elixir directives - this is an unpublished draft FYI: https://medium.com/@rwdaigle/89190b05560
[10:26] <chrismccord> rwdaigle : "I contend, though there may be implementation reasons for this many directives, their multiplicity is detrimental to the new developer experience."
[10:26] <chrismccord> rwdaigle : this probably sums up the situation well
[10:26] <chrismccord> rwdaigle : 1) they are necessary, and must be understood
[10:26] <chrismccord> rwdaigle 2) they can initially be confusing to newcomers
[10:27] <chrismccord> that said, I don't believe we can collapse them
[10:27] <badger> Was thinking that. There's always a little confusion over the "use" keyword though.
@rwdaigle
rwdaigle / parallel.ex
Last active January 22, 2016 18:23
Parallel processing
defmodule Worker do
def work(num) do
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
|> String.split
|> Enum.map(&String.upcase/1)
|> Enum.join
end
end
iterations = 100000
@rwdaigle
rwdaigle / process.ex
Last active August 29, 2015 14:23
Parallelized collection processing w/ sub-process supervision
alias Task.Supervisor
{:ok, supervisor} = Supervisor.start_link
double = fn(n) -> n*2 end
[1, 2, 3]
|> Enum.map(&Supervisor.async(supervisor, fn -> double.(&1) end))
|> Enum.map(&Task.await/1)
#=> [2, 4, 6]
@rwdaigle
rwdaigle / community.md
Last active December 18, 2015 07:48
Definition of a community

What is "community"?

A community is a group of people that:

  • Have a vested interest, and shared participation, in a common purpose
  • Assist one another (thus accruing social capital)
  • Congregate in a common location. They have a "sense of place, locale, or boundaries".
  • Have identified leaders, recognized through their contributions to the community

A community is not a site or a physical meetup. Rather, these are the virtual and physical manifestations of a community.

@rwdaigle
rwdaigle / bundle.pem
Created May 2, 2013 16:44
Comodo SSL certificate chain. Last updated May 2, 2013
-----BEGIN CERTIFICATE-----
MIIFAzCCA+ugAwIBAgIQGLLLuqME8aAPwfLzJkYqSjANBgkqhkiG9w0BAQUFADCB
gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV
BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw
MDBaFw0xOTEyMzEyMzU5NTlaMHIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVh
dGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9E
TyBDQSBMaW1pdGVkMRgwFgYDVQQDEw9Fc3NlbnRpYWxTU0wgQ0EwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCt8AiwcsargxIxF3CJhakgEtSYau2A1NHf
5I5ZLdOWIY120j8YC0YZYwvHIPPlC92AGvFaoL0dds23Izp0XmEbdaqb1IX04XiR