Command Mode
i - Insert Mode
a - Insert after the character
I - Insert at the beginning of the line
A - Insert at the end of the line
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 Quackable | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def has_voice(word) | |
@words ||= [] | |
@words << word | |
end |
After migrating from heroku to dokku, we had to also chance codeship so we deploy to dokku. I followed the following steps to successfully deploy to dokku.
- Save the public key of the codeship project. It is found in Project Settings > General Settings.
- Copy the public key to a file /tmp/codeship_projectname.pub.
- Make sure when pasting, all the contents are in a single line and not multiple lines.
- Add the public key to dokku using the following command in console. Reference.
cat /tmp/codeship_projectname.pub | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]"
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
require 'ruleby' | |
include Ruleby | |
class CoffeeOperationRulebook < Rulebook | |
# Note the rules do not have to be in order | |
def rules | |
rule [Machine, :m, m.status == :GRINDING] do |v, e| | |
puts "Grinding complete, puring coffee" | |
v[:m].status = :POURING | |
e.modify v[:m] |
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
<a href="javascript:var l = document.location; new_href = l.origin + '.eaccess.ub.tum.de' + l.pathname + l.search; window.location.href = new_href">Access with TUM</a> |
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
set :whenever_command, "bundle exec whenever" | |
set :whenever_identifier, defer { "#{:myappname}_#{:production}" } | |
require "whenever/capistrano" | |
after "deploy:restart", "whenever:update_crontab" |
NewerOlder