Skip to content

Instantly share code, notes, and snippets.

View xrimpy's full-sized avatar

Manmeet xrimpy

  • Saeloun
  • Delhi, India
View GitHub Profile
@xrimpy
xrimpy / gist:e8a4903fdadf9a0387cd
Created October 5, 2014 20:36
Upload directly to S3
#application_helper.rb
def s3_upload_policy_document(filename)
ret = {"expiration" => 30.minutes.from_now.utc.xmlschema,
"conditions" => [
{"bucket" => ENV['S3BUCKET']},
["starts-with", "$key", filename],
{"acl" => "private"},
{"success_action_status" => "200"},
@xrimpy
xrimpy / gist:8356eeb1c14d836cad71
Created August 26, 2014 14:22
CitrusPay - SSL Form Integration
<%
@vanityUrl = "quickcompany";
@currency = "INR";
@merchantTxnId = @cart.id.to_s
@orderAmount = "1231";
@apikey = ENV["CITRUS_APIKEY"]
@returnURL = "http://www.quickcompany.in/orders/" + @merchantTxnId
@data = @vanityUrl + @orderAmount + @merchantTxnId + @currency
@signature = Digest::HMAC.hexdigest(@data, @apikey, Digest::SHA1)