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
Spree.config do |config| | |
config.logo = "logo.png" | |
config.use_s3 = true | |
config.s3_bucket = "asdasd" | |
config.s3_access_key = "asdasd" | |
config.s3_secret = "asdasd" | |
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
module Spree | |
CheckoutController.class_eval do | |
def update | |
if @order.update_attributes(object_params) | |
fire_event('spree.checkout.update') | |
return if after_update_attributes | |
unless @order.next | |
flash[:error] = @order.errors[:base].join("\n") | |
redirect_to checkout_state_path(@order.state) and return |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> | |
<title>Funções JavaScript - Exemplos de uso</title> | |
</head> | |
<body> | |
</body> | |
<script type="text/javascript"> |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title><%= content_for?(:title) ? yield(:title) : "2Pay" %></title> | |
<meta name="description" content="2Pay"> | |
<meta name="author" content="Plano Bê"> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title><%= content_for?(:title) ? yield(:title) : "2Pay" %></title> | |
<meta name="description" content="2Pay"> | |
<meta name="author" content="Plano Bê"> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> |
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
def self.total_volume(transactions) | |
total = 0 | |
if transactions.is_a?(Array) | |
transactions.each do |transaction| | |
total += transaction.amount | |
end | |
else | |
total += transactions.amount | |
end | |
total |
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
### RVM aliases | |
alias project_one="rvm use 1.9.3@project_one" | |
alias project_two="rvm use 2.0.0@rails3213" | |
alias project_three="rvm use 1.9.3@rails4" | |
alias project_four="rvm use 1.9.3@project_four" | |
#You'll create gemsets that will make sense on your project, this is just an example and I hope it will help you :) |
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
class RiakWrapper | |
def self.setup | |
walk_server = WalkServer.first | |
@client ||= Riak::Client.new(:protocol => "pbc", :host => walk_server.host, :pb_port => walk_server.pb_port) | |
end | |
def self.exists?(key, bucket_name) | |
get_bucket(bucket_name) | |
@bucket.exists?(key) | |
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
class RiakWrapper | |
def initialize | |
walk_server = WalkServer.first | |
@client = Riak::Client.new(:protocol => "pbc", :host => walk_server.host, :pb_port => walk_server.pb_port) | |
end | |
def exists?(key, bucket_name) | |
bucket(bucket_name).exists?(key) | |
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
# HERE IS HOW I USE RIAKWRAPPER | |
# | |
def destroy_on_riak | |
# DELETING ON RIAK | |
acronym = current_company.acronym | |
wrapper = RiakWrapper.new(walk_server_client) | |
wrapper.delete("#{acronym}_#{self.number}", 'terminals') | |
wrapper.delete("#{acronym}_#{self.number}_params.dat", 'assets') |