- git clone Discourse
gem install rubberrubber vulcanize discourse- Edit rubber.yml
cap rubber:create_stagingand you've got a fully functioning discourse site
###Long Version:
git clone https://github.com/discourse/discourse.git
| class Me | |
| def name | |
| @name | |
| end | |
| def name=(name) | |
| @name = name | |
| end |
| // Works for 13195 and larger numbers like 901234567 but fails when I add a digit let alone for 600851475143. | |
| // The prime factors of 13195 are 5, 7, 13 and 29 | |
| // What is the largest prime factor of the number 600851475143 | |
| package main | |
| import ( | |
| "fmt" | |
| ) |
| View | |
| <%= form_for image do |f| %> | |
| <%= link_to "Pick File", "#", class: 'filepicker' %> | |
| <%= f.hidden_field :remote_url %> | |
| <%= f.hidden_field :filepicker_url %> | |
| <%= f.hidden_field :attachment_file_size %> | |
| <%= f.hidden_field :attachment_file_name %> | |
| <%= f.hidden_field :attachment_content_type %> | |
| <% end %> | |
| # A common method you'll find on the internet for a deep_find in a Hash | |
| def deep_find(key) | |
| key?(key) ? self[key] : self.values.inject(nil) {|memo, v| memo ||= v.deep_find(key) if v.respond_to?(:deep_find) } | |
| end | |
| # Let's break this up without the ternarys | |
| def deep_find(key) | |
| if key?(key) | |
| self[key] | |
| else |
| Image.where(attachment_meta: nil).each do |img| | |
| meta = {} | |
| Image.attachment_definitions[:attachment][:styles].merge({:original => nil}).keys.each do |style| | |
| url = img.attachment.url(style) | |
| uploaded_file = URI.parse(url) | |
| begin | |
| file = Paperclip.io_adapters.for(uploaded_file) |
| ["x", "y", "w", "h"].each do |coord| | |
| crop = "crop_#{coord}" | |
| define_method crop do | |
| self.coordinates[crop] | |
| end | |
| define_method "#{crop}=" do |int| | |
| self.coordinates[crop] = int | |
| end |
| (function() { | |
| var first_parent, i, img, imgs, second_parent; | |
| imgs = document.getElementsByTagName("img"); | |
| img = void 0; | |
| i = 0; | |
| while (i < imgs.length) { |
| # | |
| # bash completion support for core Git. | |
| # | |
| # Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
| # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
| # Distributed under the GNU General Public License, version 2.0. | |
| # | |
| # The contained completion routines provide support for completing: | |
| # | |
| # *) local and remote branch names |
| # in app/controllers/products_controller.rb | |
| def index | |
| @products = Product.all | |
| respond_to do |format| | |
| format.js { render partial: 'shared/app/article', | |
| collection: @products, | |
| as: :object } | |
| format.html | |
| end |