- modularity
- encapsulation
- predictability
- extensibility
- integrability
- explicitness
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
[difftool "Kaleidoscope"] | |
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" | |
[diff] | |
tool = Kaleidoscope | |
[difftool] | |
prompt = false | |
[mergetool "Kaleidoscope"] | |
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot | |
trustExitCode = true | |
[mergetool] |
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 ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document | |
def build_page_content | |
build_flash_messages | |
div :id => "active_admin_content", :class => (skip_sidebar? ? "without_sidebar" : "with_sidebar") do | |
build_sidebar unless skip_sidebar? | |
build_main_content_wrapper | |
end | |
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
createuser -s -U $USER |
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
# source_for(Person.new, :update) | |
def source_for(object, method) | |
location = object.method(method).source_location | |
`mate #{location[0]} -l #{location[1]}` | |
location | |
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
# This has the effect of moving all the lower items up one. | |
def decrement_positions_on_lower_items(position=nil) | |
return unless in_list? | |
position ||= send(position_column).to_i | |
acts_as_list_class.unscoped.update_all( | |
"#{position_column} = (#{position_column} - 1)", "#{scope_condition} AND #{position_column} > #{position}" | |
) | |
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
%h1= "Listing " + "#{resource_name}s" | |
.btn-group.pull-right | |
= link_to "All #{resource_name(item: resource_class.superclass)}s", polymorphic_path([:admin, resource_class.superclass]), class: 'btn' | |
= link_to "Add #{resource_name}", new_resource_path, class: 'btn-primary btn' | |
%br | |
%br | |
%table.table.table-bordered.table-striped#sortable{:data => {update_url: polymorphic_path([:sort, :admin, resource_class])}} |
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
p ModelName.method(:method_name).source_location |