#Basic Stuff#
##Movements##
- Goto next word w
- Goto previous word b
- Select inner word viw
- Select the inner block - vi{
- Go to closing or opening tag - %
namespace :migrations do | |
DB_PATH = ActiveRecord::Migrator.migrations_path | |
SEPARATOR = " --- " | |
UPTO = ENV['upto'] | |
def run_command(command) | |
%x(#{command}).tap do |result| | |
status = $? | |
unless status.success? | |
raise "Command Error -- (#{status.exitstatus}): [#{command}]" |
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
class Object | |
alias :old_instance_eval :instance_eval | |
def instance_eval(str, *args) | |
throw :evaling, [true, old_instance_eval(str)] | |
end | |
end | |
$result = catch(:evaling) do | |
<%= user_code %> |
module Newal | |
def eval(str) | |
throw :evaling, [true, Kernel.eval(str)] | |
end | |
end | |
class << self | |
include Newal | |
end |
#Basic Stuff#
##Movements##
# encoding: utf-8 | |
require 'bloops' | |
class Bloopsaposi | |
def initialize | |
@x = {119135 => "2:"} | |
@q = [] | |
@b = Bloops.new |
# encoding: utf-8 | |
class NP | |
def initialize a=@p=[], b=@b=[] | |
end | |
def +@ | |
@b << 1 | |
b2c | |
end |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
" ------ | |
" Vundle | |
" ------ | |
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() |
# gem install sishen-rtranslate | |
class String | |
require 'rtranslate' | |
def to_de | |
Translate.t self, "ENGLISH", "GERMAN" | |
end | |
end | |
puts "you're welcome".to_de |