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
| #!/bin/zsh | |
| if command -v rbenv >/dev/null 2>&1; then | |
| export RUBY_VERSION=$(rbenv version-name) | |
| export RBENV_INSTALLED=1 | |
| else | |
| export RUBY_VERSION=$(ruby -v | awk '{print $2}') | |
| export RBENV_INSTALLED=0 | |
| fi |
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
| Service.api_key = "<API_KEY>" | |
| results = Service.ask!("What is this?") | |
| => [{ a: "b", c: 78.12 }] |
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
| curl https://api.service.com/v1/detect \ | |
| -H "Authorization: Bearer <API_KEY>" \ | |
| -d q=What+is+this | |
| => {"results":[{"a":"b","c":83.77}]} |
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
| after "deploy:restart", "resque:stop_workers" | |
| namespace :resque do | |
| task :stop_workers, :except => { :no_release => true } do | |
| run "cd #{current_path} && rake RAILS_ENV=#{rails_env} resque:stop_workers" | |
| end | |
| end |