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
| Searching 2363 files for "has_many" | |
| /Users/fernando/freelas/takiweb_dev/app/models/address.rb: | |
| 18: has_many :clients | |
| 19: has_many :app_users | |
| /Users/fernando/freelas/takiweb_dev/app/models/app.rb: | |
| 25: has_many :orders | |
| 26: has_many :markets | |
| 27: has_many :app_users |
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
| { | |
| "complement_categories": [ | |
| { | |
| "id": 7, | |
| "market_id": 1, | |
| "item_id": 1, | |
| "name": "Borda", | |
| "min_quantity": 1, | |
| "max_quantity": 1, | |
| "is_required": 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
| <script type="text/javascript"> | |
| <% for key, msg in flash %>; | |
| <% case key %> | |
| <% when "notice" %> | |
| $.notify({ | |
| message: "<%= msg %>", | |
| icon: 'fa fa-check' | |
| },{ | |
| type: "success" | |
| }); |
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
| { | |
| "city":{"name": "Palmeiras do Tocantins", "state":"TO", "location":{"lat": -6.616584, "lng": -47.546429}}, | |
| "city":{"name": "Barro Preto", "state":"BA", "location":{"lat": -14.794773, "lng": -39.476029}}, | |
| "city":{"name": "Fernando de Noronha", "state":"PE", "location":{"lat": -3.839601, "lng": -32.410733}}, | |
| "city":{"name": "Campo de Santana", "state":"PB", "location":{"lat": -6.487585, "lng": -35.636707}}, | |
| "city":{"name": "Pracuúba", "state":"AP", "location":{"lat": 1.745427, "lng": -50.789248}}, | |
| "city":{"name": "Amapá", "state":"AP", "location":{"lat": 2.052669, "lng": -50.795653}}, | |
| "city":{"name": "Bujari", "state":"AC", "location":{"lat": -9.815277, "lng": -67.955029}}, | |
| "city":{"name": "Plácido de Castro", "state":"AC", "location":{"lat": -10.280640, "lng": -67.137133}}, | |
| "city":{"name": "Tarauacá", "state":"AC", "location":{"lat": -8.156975, "lng": -70.772154}}, |
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
| cat file.txt | pbcopy |
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
| module Searchable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def filter(filter_params) | |
| filter_params_keys = filter_params.symbolize_keys | |
| results = self.where(nil) | |
| filter_params_keys.each do |key, value| | |
| results = results.where(self.arel_table[key].matches("%#{value}%")) | |
| 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
| STDOUT.puts "Do you wish to clean your current database? \n Please respond with 'yes' or 'no' (or 'y' or 'n'). \n" | |
| answer = STDIN.gets.chomp |
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
| Let's say you have two commits in your branch: | |
| $ git log --oneline origin/master..new-feature | |
| 73bbc09 Hack some more | |
| f33b240 Hack hack | |
| What the project maintainer wants is a single commit in the diff between your new-feature branch and the project's master branch. What we need here is the interactive rebase feature of Git: | |
| $ git rebase -i origin/master | |
| This will open your editor with these contents: |
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
| # I am pasting that into setup steps | |
| # binary provided by the amazing Codeship.io support | |
| PHANTOMJS_URL="https://s3.amazonaws.com/codeship.io/checkbot/binaries/phantomjs_2.0.1" | |
| set -e | |
| rm -rf ~/.phantomjs | |
| wget --continue "${PHANTOMJS_URL}" -O "${HOME}/cache/phantomjs" | |
| ln -s "${HOME}/cache/phantomjs" "${HOME}/bin/" | |
| chmod +x "${HOME}/bin/phantomjs" |