This file contains 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
lib/tasks/act_celluloid.rake | |
namespace :act_celluloid do | |
task :crawl => :environment do | |
app_ids = get_items | |
supervisor = Celluloid::SupervisionGroup.run! | |
supervisor.pool(AppActor, as: :app_actors, size: 10) | |
futures = [] |
This file contains 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
require 'vlad/sidekiq' | |
task "vlad:deploy" => %w[ | |
vlad:update | |
vlad:bundle:install | |
vlad:migrate | |
vlad:assets:precompile | |
vlad:sidekiq:restart | |
vlad:start_app | |
vlad:cleanup |
This file contains 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
if Rails.env.production? | |
Sidekiq.configure_server do |config| | |
config.redis = { :url => 'redis://10.0.WX.YZ:6379/12', :namespace => 'sidekiq' } | |
end | |
Sidekiq.configure_client do |config| | |
config.redis = { :url => 'redis://10.0.WX.YZ:6379/12', :namespace => 'sidekiq' } | |
end | |
end |
This file contains 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
# /etc/init/workers.conf - manage a set of Sidekiqs | |
# This example config should work with Ubuntu 12.04+. It | |
# allows you to manage multiple Sidekiq instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# See sidekiq.conf for how to manage a single Sidekiq instance. | |
# | |
# Use "stop workers" to stop all Sidekiq instances. | |
# Use "start workers" to start all instances. |
This file contains 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
# /etc/init/sidekiq.conf - Sidekiq config | |
# This example config should work with Ubuntu 12.04+. It | |
# allows you to manage multiple Sidekiq instances with | |
# Upstart, Ubuntu's native service management tool. | |
# | |
# See workers.conf for how to manage all Sidekiq instances at once. | |
# | |
# Save this config as /etc/init/sidekiq.conf then mange sidekiq with: | |
# sudo start sidekiq index=0 |
This file contains 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
# rails g model Book name:string:index isbn:string:uniq description:text user:references content:string{30} | |
class CreateBooks < ActiveRecord::Migration | |
def change | |
create_table :books do |t| | |
t.string :name | |
t.string :isbn | |
t.text :description | |
t.references :user, index: true | |
t.string :content, limit: 30 |
This file contains 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
# rails g model Book name:string:index description:text ‘cost:decimal{5,2}’ | |
class CreateBooks < ActiveRecord::Migration | |
def change | |
create_table :books do |t| | |
t.string :name | |
t.text :description | |
t.decimal :cost, precision: 5, scale: 2 | |
t.timestamps | |
end |
This file contains 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
# ruby gitsearch.rb | |
search_term = "elasticsearch" | |
file_types = "*.rb" | |
`echo "\n############################" >> search_results.txt` | |
`echo "Search Term: #{search_term}" >> search_results.txt` | |
`echo "File Types: #{file_types}" >> search_results.txt` | |
`echo "############################\n" >> search_results.txt` |
This file contains 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
<h3>Display Coordinates</h3> | |
<p id="geo_loc"></p> | |
<script> | |
function success(position) { | |
var latitude = position.coords.latitude; | |
var longitude = position.coords.longitude; | |
output.innerHTML = '<p>Latitude is ' + latitude + '<br>Longitude is ' + longitude + '</p>'; | |
}; |
This file contains 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
1. Create new container | |
a) docker run -i -t ubuntu /bin/bash | |
b) docker run --name rails_dev_container -i -t ubuntu ubuntu /bin/bash | |
The command line flags - i -t provide an interactive shell in the new container | |
2. Show running docker containers ==> docker ps | |
3. Show list of current containers ==> | |
a) docker ps -a (Show all containers, both stopped and running) | |
b) docker ps -n x (shows the last x containers, running or stopped, ex: docker ps -n 5) |
OlderNewer