Emacs Commands
- C-f: move cursor forward one char
- C-b: mover cursor back one chart
- C-n: mover cursor to next line
- C-p: go to previous line
- M-f: forward one word
- M-b: move backward one word
class Eva < Zebra | |
include MongoMapper::Document | |
include Vegan::Powers | |
include MongoMapperExt::Taggable | |
include MongoMapper::Tweetable | |
## Keys | |
key :scarves_count, Integer, :default => 20 | |
key :compliments_count, Integer, :default => 100 |
project :test => :shoulda, :orm => :mongomapper, :mock => :none, :script => :jquery, :renderer => :slim, :stylesheet => :compass, :admin_renderer => :erb | |
# include additional generators | |
inject_into_file destination_root('config/boot.rb'), "\# include additional generators\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_page_generator.rb')\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_generator.rb')\n\n", :before => "Padrino.load!" | |
require_dependencies 'kaminari', :require => 'kaminari/sinatra' | |
require_dependencies 'bcrypt-ruby', :require => 'bcrypt' | |
git :init | |
git :add, "." |
class CommandWithErrors < Imperator::Command | |
def initialize(*args) | |
super(*args) | |
@errors = ActiveModel::Errors.new(self) | |
end | |
end | |
(eval-when-compile | |
(require 'color-theme)) | |
;;;###autoload | |
(defun color-theme-molokai () | |
"Color theme based on the Molokai color scheme for vim." | |
(interactive) | |
(color-theme-install | |
'(color-theme-molokai | |
((foreground-color . "#F8F8F2") |
require 'mongo' | |
require 'mongo_mapper' | |
MongoMapper.connection = Mongo::Connection.new('localhost', nil) | |
MongoMapper.database = 'sandbox_poly' | |
class Commentable | |
include MongoMapper::Document | |
many :comments, :as => :commentable |
So you want to add Joomla! 3.0 compatibility to your component? The old MVC is still available but unfortunately, the names of the classes have changed.
Just add the following somewhere, then rename all your classes to extend the legacy classes. After that all you have to do is make sure you're not using any depreciated methods. Of course, eventually you should work on full compatibility you lazy developer!
<?php
jimport('joomla.application.component.controller');
jimport('joomla.application.component.view');
jimport('joomla.application.component.model');
require 'mongo_mapper' | |
MongoMapper.connection = Mongo::Connection.new('localhost') | |
MongoMapper.database = 'playground' | |
class Parent | |
include MongoMapper::Document | |
key :name, String | |
many :children | |
end |
#!/bin/bash | |
if [ -z "$1" ]; then | |
wdir="." | |
else | |
wdir=$1 | |
fi | |
for f in $( find . -name '*.erb' ); do | |
out="${f%.erb}.haml" | |
if [ -e $out ]; then |