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 random_token(number=10) | |
| Digest::SHA1.hexdigest(Time.now.to_i.to_s)[1..number] | |
| 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
| source ~/.git-completion.sh | |
| alias gco='git co' | |
| alias gci='git ci' | |
| alias grb='git rb' | |
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
| config.generators do |g| | |
| g.test_framework :rspec, :fixture => true, :view_specs => false, :routing_specs => false, :helper_specs => false, :integration_specs => false | |
| g.integration_tool :cucumber | |
| g.stylesheets false | |
| g.fixture_replacement :factory_girl, :dir => 'spec/factories' | |
| g.form_builder :simple_form | |
| g.template_engine :haml | |
| 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
| <a href="https://github.com/yorzi"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://assets0.github.com/img/e6bef7a091f5f3138b8cd40bc3e114258dd68ddf?repo=&url=http%3A%2F%2Fs3.amazonaws.com%2Fgithub%2Fribbons%2Fforkme_right_red_aa0000.png&path=" alt="Fork me on GitHub"></a> |
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
| # see http://forrst.com/posts/Setting_up_SASS_on_Heroku-4dZ | |
| # You can put this in config/initializers/sass.rb | |
| # Setup directory in tmp/ to dump the generated css into | |
| require "fileutils" | |
| FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "generated")) | |
| # Tell SASS to use the .sass files in public/stylesheets/sass and | |
| # output the css to tmp/stylesheets/generated |
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
| $(document).ready(function(){ | |
| date_obj = new Date(); | |
| date_obj_hours = date_obj.getHours(); | |
| date_obj_mins = date_obj.getMinutes(); | |
| if (date_obj_mins < 10) { date_obj_mins = "0" + date_obj_mins; } | |
| if (date_obj_hours > 11) { | |
| date_obj_hours = date_obj_hours - 12; | |
| date_obj_am_pm = " PM"; |
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
| RuntimeError in GroupsController#create | |
| ProfilePhoto#content_type delegated to photo.content_type, but photo is nil: #<ProfilePhoto id: nil, user_id: 6, owner_id: 5, owner_type: "Group", title: nil, description: nil, upload_id: nil, status: "processed", created_at: nil, updated_at: nil, size: nil, height: nil, width: nil, filename: nil, content_type: nil, parent_id: nil, photo_id: nil> | |
| Rails.root: /Users/andy/intridea.workspace/recnation | |
| Application Trace | Framework Trace | Full Trace | |
| vendor/gems/ss_photos/app/models/profile_photo.rb:26:in `rescue in content_type' | |
| vendor/gems/ss_photos/app/models/profile_photo.rb:23:in `content_type' | |
| (eval):25:in `image_content_type' | |
| activemodel (3.1.0.rc4) lib/active_model/validator.rb:151:in `block in validate' |
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
| # usage: | |
| # link_to_next_page(@items) | |
| # link_to_next_page(@items, :remote => true) # Ajax | |
| def link_to_next_page(scope, name, options = {}, &block) | |
| param_name = options.delete(:param_name) || Kaminari.config.param_name | |
| link_to_unless scope.last_page?, name, {param_name => (scope.current_page + 1)}, options.merge(:rel => 'next') do | |
| block.call if block | |
| 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
| $.fn.extend | |
| myplugin: (options) -> | |
| self = $.fn.myplugin | |
| opts = $.extend {}, self.default_options, options | |
| $(this).each (i, el) -> | |
| self.init el, opts | |
| self.log el if opts.log | |
| $.extend $.fn.myplugin, | |
| default_options: |
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
| function signInModal(){ | |
| $( "#sign_in" ).dialog({ | |
| modal: true, | |
| autoOpen: $("body").hasClass("show_login"), | |
| resizable: false, | |
| minWidth: 400 | |
| }); | |
| $("a.login, a#login_link").click(function(){ | |
| $( "#sign_in" ).dialog("open"); |