Skip to content

Instantly share code, notes, and snippets.

@alininja
alininja / kitchen.log
Created August 18, 2015 19:52
Chef Kitchen can't converge with Windows winrm
I, [2015-08-18T08:56:06.351051 #7010] INFO -- Kitchen: -----> Starting Kitchen (v1.4.0)
I, [2015-08-18T08:56:07.738878 #7010] INFO -- Kitchen: -----> Creating <default-windows-2008r2>...
I, [2015-08-18T08:57:28.013755 #7010] INFO -- Kitchen: -----> Converging <default-windows-2008r2>...
E, [2015-08-18T09:25:42.328957 #7010] ERROR -- Kitchen: ------Exception-------
E, [2015-08-18T09:25:42.329015 #7010] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2015-08-18T09:25:42.329038 #7010] ERROR -- Kitchen: Message: Failed to complete #converge action: [[WinRM::Transport::FileTransporter] Upload failed (exitcode: 1)
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">The term 'Function' is not recognized as the name of a cmdlet, function, script_x000D__x000A_</S><S S="Error"> file, or operable program. Check the spelling of the name, or if a path was in_x000D__x000A_</S><S S="Error">cluded, verify that the path is correct and try again._x000D__x000A_</S><S S="E
@alininja
alininja / coolWidget.js.coffee
Created July 1, 2013 20:40
Bootstrap-ish jQuery plugin structure in CoffeeScript
((context, $) ->
# COOL WIDGET CLASS DEFINITION
#===================================
context = (element, options) ->
@options = options
@$element = $(element).on('change', 'input[type=checkbox]', $.proxy(@update, this))
context:: =
constructor: context
update: ->
@alininja
alininja / checkout_controller_decorator.rb
Created September 3, 2012 17:51
Validate Promotions
Spree::CheckoutController.class_eval do
require_dependency 'spree/order_decorator'
rescue_from Spree::Order::CouldNotValidateMailingListPromoCode do |exception|
flash[:error] = t(exception.message)
redirect_to checkout_state_path(@order.state)
end
end
@alininja
alininja / elavon.rb
Created August 18, 2012 10:46
Elavon Gateway :test_mode
#app/models/spree/gateway/elavon.rb
module Spree
class Gateway::Elavon < Gateway
preference :login, :string
preference :password, :string
preference :user, :string
attr_accessible :preferred_login, :preferred_password, :preferred_user
@alininja
alininja / 20120501085533_create_translation_tables.rb
Created August 13, 2012 11:46
Can't Globalize Spree::PaymentMethod
#db/migrate/20120501085533_create_translation_tables.rb
class CreateTranslationTables < ActiveRecord::Migration
def up
Spree::PaymentMethod.create_translation_table! :name => :string
Spree::Product.create_translation_table! :name => :string, :description => :text, :ingredients => :text
Spree::Taxon.create_translation_table! :name => :string
Spree::OptionType.create_translation_table! :presentation => :string
Spree::OptionValue.create_translation_table! :presentation => :string
@alininja
alininja / _edit_row.html.erb
Created June 27, 2012 21:24
Reset button not recognizing new form values after AJAX response
<tr id='event_edit_<%= event.id %>' style='display:none;'>
<%= form_for(event, {:remote => true, :namespace => :blah, :html => {:class => ['blah', 'event']}}) do |f| %>
<td class='edit title'><%= f.text_field :title %></td>
<td class='edit description'><%= f.text_area :description %></td>
<td class='edit submit'><%= f.submit %></td>
<td class='edit cancel'><%= button_tag 'Reset', :type => 'reset' %></td>
<% end %>
</tr>
@alininja
alininja / application.rb
Created June 21, 2012 10:27
uninitialized constant Spree::Calculator::CouldNotCalculateShipping (NameError)
# config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
@alininja
alininja / calculator_decorator.rb
Created May 28, 2012 10:55
Spree Calculator Exception Handling
# app/models/spree/calculator_decorator.rb
Spree::Calculator.class_eval do
class Spree::Calculator::CouldNotCalculateShipping < StandardError
end
class Spree::Calculator::CouldNotValidateOrder < StandardError
end
end