Original source here.
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
| ### Install neo4j | |
| brew install neo4j | |
| ### Disable auth | |
| code /usr/local/Cellar/neo4j/4.3.7/libexec/conf/neo4j.conf | |
| # uncomment this line: | |
| dbms.security.auth_enabled=false |
Sometimes a linter is not enough. Trying its best, it will point out to the end of file. That's ok if the file is short enough to go through it and spot it. Hoewever, sometimes that's not the case and the error is not so obvious. It's in these cases where one has to apply other techniques.
Instead of going through all the code line by line, what about using your Text Editor Fold/Unfold? For Sublime Text you have the option of folding different lvels of code.
Consider the following code:
module A
method one
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
| class User | |
| include Mongoid::Document | |
| has_many :wishlists, class_name: "Item" | |
| end | |
| In rails s: | |
| >> u = User.first | |
| >> u.wishlists.push(Item.first) |
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
| TEST.JS | |
| db.createCollection("test_index") | |
| db.test_index.ensureIndex({"t.n":"text"}) | |
| var mydocs = [ | |
| {t: [{language: "english", n: "Mother 1"},{language: "spanish", n: "Madre 1"}]}, | |
| {t: [{language: "english", n: "Spreme 1"},{language: "spanish", n: "Edificio 1"}]} | |
| ] | |
| db.test_index.insert(mydocs) |
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
| db.ratings.find().forEach(function(doc){ | |
| var item = db.items.find({_id: doc.item_id}) | |
| var ry = item.detail.ry | |
| }) | |
| ITEM |
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
| olds = Item.order_by(id: 1).skip(new_batch*10000).limit(10000).not_in(id: set) | |
| olds.each do |doc| | |
| ... | |
| 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
| <%= form_for @user, url: admin_user_path(@user) do |f| %> | |
| <%= f.label :name %> | |
| <%= f.text_field :name %> | |
| <br> | |
| <%= f.label :email %> | |
| <%= f.text_field :email %> | |
| <br> | |
| <%= f.label :roles %> | |
| <%= f.fields_for :roles do |roles_fb| %> |
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
| irb(main):028:0* User.collection | |
| => #<Moped::Collection:0x007fcb8dafed20 @database=#<Moped::Database:0x007fcb8dafeeb0 @session=<Moped::Session seeds=[<Moped::Node resolved_address="54.74.247.101:63879">] database=gemfeeddb>, @name="gemfeeddb">, @name="users"> | |
| irb(main):029:0> User.collection.remove | |
| NoMethodError: undefined method `remove' for #<Moped::Collection:0x007fcb8db07678> | |
| from (irb):29 | |
| from /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start' | |
| from /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start' | |
| from /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console' | |
| from /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!' | |
| from /Users/borjagvo/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.4/lib/rail |
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 json: { | |
| item: { | |
| name: item.name, | |
| kind: item.kind, | |
| details_en: item.details_en | |
| }, | |
| rating: item.ratings.where(user_id: @current_user.id) | |
| } |
NewerOlder