Skip to content

Instantly share code, notes, and snippets.

View robinboening's full-sized avatar

Robin Böning robinboening

View GitHub Profile

Keybase proof

I hereby claim:

  • I am robinboening on github.
  • I am robinboening (https://keybase.io/robinboening) on keybase.
  • I have a public key ASCYeddqFgXBH2Vb9QWJaGKAmntKyCOLWzGfXwNqqfjapwo

To claim this, I am signing this object:

@robinboening
robinboening / deploy.rb
Created March 30, 2015 08:55
Basic deploy.rb for alchemy_cms
require 'bundler/capistrano'
require 'alchemy/capistrano'
require 'capistrano/ext/multistage'
set :bundle_without, %w(development test)
set :bundle_flags, "--deployment --binstubs"
set :use_sudo, false
set :scm, :git
@robinboening
robinboening / get_elements_from_other_site.rb
Last active August 29, 2015 14:02
Retrieve certain Alchemy::Elements from certain/default Alchemy::Site with same language_code
Alchemy::Element.joins(:page => :language).where(alchemy_languages: {language_code: @language.language_code, site_id: Alchemy::Site.default}, name: 'superhero').available
@robinboening
robinboening / alchemy_environment_syncing.rb
Created October 19, 2013 21:12
Capistrano and rake tasks to sync database, picture and attachment data of alchemy_cms between i.e. staging and production systems.
# Example usage:
# cap staging sync_with:production
# File: config/deploy/staging.rb
namespace :sync_with do
desc "Sync with production system."
task :production do
run "cd #{current_path} && RAILS_ENV=#{rails_env} #{rake} sync_with:production"
end
end
def ask_for_tag
default_tag = `git tag`.split("\n").last
if default_tag == nil
puts "Please make sure you have pushed at least one tag. (git push origin --tags)"
exit!
else
tag = Capistrano::CLI.ui.ask "Tag to deploy (make sure to push the tag first): [#{default_tag}] "
tag = default_tag if tag.empty?
tag
end
@robinboening
robinboening / capistrano_logfile_watching.rb
Created October 1, 2013 08:47
Capistrano tasks to take a look into the logfiles on the remote server.
namespace :logs do
desc "show last 100 lines of your remote logfile."
task :tail do
run "tail -n100 #{shared_path}/log/#{rails_env}.log"
end
desc "watch your logfile and see additional data being appended."
task :watch do
stream("tail -f #{shared_path}/log/#{rails_env}.log")
end
@robinboening
robinboening / capistrano_delete_remote_cache_task.rb
Last active December 24, 2015 09:09
capistrano task to remove cached_copy from remote server. (This is useful if your remote git repository has changed)
namespace :deploy do
desc "Removes the remote cache in order to deploy from a new remote repository"
task :delete_remote_cache, :except => { :no_release => true } do
run "cd #{shared_path}; rm -Rf cached-copy"
end
end
@robinboening
robinboening / player.rb
Last active January 13, 2019 06:16
ruby-warrior level6
class Player
FULL_HEALTH = 20
def play_turn(warrior)
@warrior = warrior
if need_to_rest?
if able_to_rest?
warrior.rest!
@robinboening
robinboening / ruby_confs_2013.md
Last active December 18, 2015 18:59
Ruby conferences in late 2013

LoneStar RubyConf 2013

18.07.2013 - 20.07.2013

USA, Austin

RailsCamp Germany 2013

26.07.2013 - 28.07.2013