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
guake-helix() { | |
# HelixCore | |
guake --rename-tab="CoreSpec" --execute-command="cd /home/fabio/dev/site5/helix_core && bundle exec guard" && | |
guake --new-tab=2 --rename-tab="Core" --execute-command="cd /home/fabio/dev/site5/helix_core" && | |
# Helix | |
guake --new-tab=3 --rename-tab="HelixServer" --execute-command="cd /home/fabio/dev/site5/helix && rails s" && | |
guake --new-tab=4 --rename-tab="HelixSpec" --execute-command="cd /home/fabio/dev/site5/helix && bundle exec guard" && | |
guake --new-tab=5 --rename-tab="Helix" --execute-command="cd /home/fabio/dev/site5/helix"; | |
} |
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
# IRB | |
s = Service.new | |
s.brand | |
# => nil | |
s.brand_id = 1 | |
s.brand | |
# => #<Brand id: 1, name: "Brand 1", active: false, created_at: "2012-07-11 13:24:02", updated_at: "2012-07-11 13:24:02", franchise: false, data: nil, default_payment_gateway_id: 1, tsv: "'1':2 'brand':1", currency: "USD"> |
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
# Current version | |
# - before block runs before each example | |
# - isolated examples | |
describe "GET show" do | |
before do | |
@customer = create_customer | |
get :show, id: @customer.id | |
end | |
it { should respond_with(:success) } |
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 ServiceObserver < ActiveRecord::Observer | |
def before_activate(service, transition) | |
return service.driver.provision(transition.args.extract_options!).success? | |
end | |
def before_terminate(service, transition) | |
service.driver.deprovision(transition.args.extract_options!) | |
end | |
def before_cancel(service, transition) |
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 Kindly | |
class << self | |
attr_accessor :logger | |
def for_service(service) | |
service.driver_type.camelize.constantize.new(service) | |
end | |
end | |
end | |
class Kindly::Cpanel |
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 Service | |
def handler | |
@handler ||= Kindly.with_service(self) | |
end | |
delegate :provision, :deprovision, to: :handler | |
end | |
class Kindly | |
def self.with_service(service) |
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
# product_type | |
# kindly_driver_name: | |
# configuration_key: | |
# desc: "The configuration description" | |
# unit: "The configuration unit" | |
SharedHosting: | |
hosting/cpanel: | |
bwlimit: | |
desc: "Bandwidth Limit" | |
disk_quota: |
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
1.9.3p194 :105 > Customer.count | |
(4.5ms) SELECT COUNT(*) FROM "customers" | |
=> 10025 | |
1.9.3p194 :106 > Contact.count | |
(8.2ms) SELECT COUNT(*) FROM "contacts" | |
=> 20050 | |
1.9.3p194 :107 > Address.count | |
(9.3ms) SELECT COUNT(*) FROM "addresses" | |
=> 30125 | |
1.9.3p194 :108 > Hardware.count |
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
CREATE OR REPLACE VIEW searches AS ((((((((((((((((((((((((( | |
(SELECT brands.name AS term, | |
brands.id AS searchable_id, | |
'Brand'::character varying AS searchable_type | |
FROM brands | |
UNION SELECT staffs.name AS term, | |
staffs.id AS searchable_id, | |
'Staff'::character varying AS searchable_type | |
FROM staffs) | |
UNION |
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
LoadError in # | |
Showing /home/fabio/dev/site5/helix/app/views/layouts/application.html.erb where line #31 raised: | |
cannot load such file -- ["ok","(function() {\n\n $(document).ready(function() {\n $('form li.error:first input').focus();\n $('table.sortable').each(function(i, t) {\n var config, headers, table;\n table = $(t);\n headers = table.find('thead th');\n config = {\n headers: {}\n };\n headers.each(function(i, h) {\n var header, hide;\n header = $(h);\n hide = header.hasClass('actions' || header.hasClass('no-sort'));\n if (hide) {\n return config.headers[i] = {\n sorter: false\n };\n }\n });\n return table.tablesorter(config);\n });\n return $('[name=\"customer_autocomplete\"]').each(function(i, customer_input) {\n var customer_id_input;\n customer_input = $(customer_input);\n customer_id_input = customer_input.parents('form:first').find('[name*=\"customer_id\"]') |