This file contains hidden or 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
{ | |
"auto_complete": true, | |
"check_for_rbenv": true, | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme", | |
"default_encoding": "UTF-8", | |
"draw_white_space": "all", | |
"file_exclude_patterns": | |
[ | |
"*.pyc", |
This file contains hidden or 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
<% [:notice, :error, :alert, :success].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert alert-<%= flash_class(level) %>"> | |
<a class="close" href="#" data-dismiss="alert">×</a> | |
<%= flash[level] %> | |
</div> | |
<% end %> | |
<% end %> |
This file contains hidden or 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
render :text => params.inspect |
This file contains hidden or 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
<div class="control-group <%= control_group_error(@model, :field_name) %>"> | |
<%= f.label :field_name, :class => "control-label" %> | |
<div class="controls"> | |
<%= f.text_field :field_name %> | |
<%= error_help_text(@model, :field_name) %> | |
</div> | |
</div> |
This file contains hidden or 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
self.markdownable_columns.each do |markdown_column| | |
define_method :"#{markdown_column}_html" do | |
if value = send(markdown_column) | |
<Application>::Application.config.markdown_renderer.render(value).html_safe | |
end | |
end | |
end |
This file contains hidden or 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
// Should be used to modify the default spacing between objects (not between nodes of * the same object) | |
// p,m = padding,margin | |
// a,t,r,b,l,h,v = all,top,right,bottom,left,horizontal,vertical | |
// x,s,m,l,n = extra-small($x),small($s),medium($m),large($l),none(0px) | |
$x: 3px; | |
$s: 5px; | |
$m: 10px; | |
$l: 20px; | |
.ptn, .pvn, .pan { |
This file contains hidden or 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
# Delegate in a block to set up multiple delegations | |
with_options allow_nil: true do |product_delegate| | |
product_delegate.delegate :fields, to: :product_type | |
end | |
# Delegate as a method call | |
delegate :fields, to: :product_type, allow_nil: true |
This file contains hidden or 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 pending_changes? | |
return false if !status.published? | |
original_attributes = Product.last.attributes.symbolize_keys.except(*publish_excluded_attributes) | |
published_attributes = Product.last.published_record.attributes.symbolize_keys.except(*publish_excluded_attributes) | |
original_attributes == published_attributes ? false : update_attribute(:published_status, 'changed') | |
end |
This file contains hidden or 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
-(void)animateButton:(UIButton *)sender | |
{ | |
CGRect originalFrame = sender.frame; | |
CGRect newFrame = CGRectMake(originalFrame.origin.x - 3, originalFrame.origin.y - 3, originalFrame.size.width + 6, originalFrame.size.height + 6); | |
[UIView animateWithDuration:0.4 delay:0 options:(UIViewAnimationOptionAutoreverse) | |
animations:^{ | |
sender.frame = newFrame; | |
} | |
completion:^(BOOL finished){ |
This file contains hidden or 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
namespace :app do | |
desc "Build static distrubution" | |
task :build do | |
puts "Building..." | |
# Shell out for now... | |
`bundle exec rake assets:clean` | |
puts "Compiling" | |
`bundle exec rake assets:precompile` | |
puts "Starting web get" |
OlderNewer