Skip to content

Instantly share code, notes, and snippets.

View sqlninja's full-sized avatar

John Henderson sqlninja

  • Henderson Holdings
  • Nashville, TN
View GitHub Profile
@sqlninja
sqlninja / 1-make-key
Created February 14, 2017 03:12 — forked from RandomEtc/1-make-key
generating SSL keys and Certificate Signing Requests for Heroku / Nginx / RapidSSL
Key was generated using:
tom% openssl genrsa -des3 -out example.com.key 2048
Generating RSA private key, 2048 bit long modulus
....+++
..........................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for example.com.key:
Verifying - Enter pass phrase for example.com.key:
%tom
@sqlninja
sqlninja / apple_helper.rb
Last active October 1, 2015 15:23
Apple IAP receipt verification
module AppleHelper
APPLE_RECEIPT_VERIFY_URL_SANDBOX = "https://sandbox.itunes.apple.com"
APPLE_RECEIPT_VERIFY_URL_PRODUCTION = "https://buy.itunes.apple.com"
def self.verify_receipt_for(b64_receipt, receipt_verify_url)
json_resp = nil
url = URI.parse(receipt_verify_url)
json_request = { 'receipt-data' => b64_receipt, 'password' => ENV!['APPLE_SHARED_SECRET'] }.to_json
resp, resp_body = Net::HTTP.start(url.host, url.port, use_ssl: url.scheme == 'https') do |http|