This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<youtube-video data-code='hkk68&$'></youtube-video> | |
<template> | |
<iframe src="http://youtube.com/#{youtube-code}/"></iframe> | |
</template> | |
<!-- I want use the youtube-video element with code to get the iframe of of YouTube video --!> | |
<!-- Is it possible to make youtube-code in template generic as a variable whose value is data-code in youtube-video? --!> | |
<!-- The template is more complex than above in reality by the way --!> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#for css | |
body#search{ | |
... | |
} | |
#for js | |
- if $('body#search').length | |
...... | |
#for layout view file, e.g. applicaiton.html.haml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near ")" | |
LINE 20: ...(CASE WHEN lower(partners_languages.language) IN () THEN 1 E... | |
^ | |
: | |
SELECT users.id FROM ( | |
SELECT users.id, (CASE WHEN lower(users.my_sector) = lower('Real Estate') THEN users.score + 2 ELSE users.score END) AS score | |
FROM ( | |
SELECT users.id, users.my_sector, SUM(location) AS score | |
FROM ( | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Incident Identifier: 57DEF0EE-1D59-4D9F-B964-F50AEDAF84E8 | |
CrashReporter Key: feb41b2edb9ca5ec937b84d25db077c80c5c2d24 | |
Hardware Model: iPod5,1 | |
Process: aggregated [28] | |
Path: /System/Library/PrivateFrameworks/AggregateDictionary.framework/Support/aggregated | |
Identifier: aggregated | |
Version: ??? | |
Code Type: ARM (Native) | |
Parent Process: launchd [1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APP_CERT_PEM = File.read("#{Rails.root}/certs/app_cert.pem") | |
APP_KEY_PEM = File.read("#{Rails.root}/certs/app_key.pem") | |
def encrypt_for_paypal(values) | |
signed = OpenSSL::PKCS7::sign(OpenSSL::X509::Certificate.new(APP_CERT_PEM), | |
OpenSSL::PKey::RSA.new(APP_KEY_PEM, ''), values.map { |k, v| "#{k}=#{v}" }.join("\n"), [], OpenSSL::PKCS7::BINARY) | |
OpenSSL::PKCS7::encrypt([OpenSSL::X509::Certificate.new(PAYPAL_CERT_PEM)], signed.to_der, OpenSSL::Cipher::Cipher::new("DES3"), OpenSSL::PKCS7::BINARY).to_s.gsub("\n", "") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% payment_service_for @order_id, @seller_account_email, | |
:amount => @total_price, | |
:currency => @currency, | |
:service => 'paypal', | |
:html => { :id => 'my-form' } do |service| %> | |
<% service.customer :first_name => @customer.first_name, | |
:last_name => @customer.last_name, | |
:phone => @customer.phone, | |
:email => @customer.email %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir certs | |
cd certs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl genrsa -out app_key.pem 1024 | |
openssl req -new -key app_key.pem -x509 -days 365 -out app_cert.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Encrypt the transaction information | |
cert_id =YAML.load(File.open("#{RAILS_ROOT}/config/paypal.yml"))[ENV["RAILS_ENV"]]['paypal']['cert_id'] | |
paypal_params = {:cert_id=>cert_id} | |
service.form_fields.collect do |field, value| | |
paypal_params.merge!({field=>value}) | |
end | |
result << hidden_field_tag(:cmd, "_s-xclick") | |
result << "\n" | |
result << hidden_field_tag(:encrypted, encrypt_for_paypal(paypal_params)) | |
# result << service.form_fields.collect do |field, value| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: | |
paypal: | |
login: | |
password: | |
signature: | |
cert_id : | |
paypal_standard: | |
email: | |
password: |
OlderNewer