:setlocal spell spelllang=en_gb
]s
Search Forward
]s
Search Backward
z=
Suggest Corrections
class ApplicationController < ActionController::Base | |
helper_method :meta_title, :meta_description | |
private | |
attr_reader :meta_title, :meta_description | |
def set_meta_title(title) | |
@meta_title = title | |
end |
var jQuery = jQuery, | |
rails = jQuery.rails, | |
document = document; | |
(function($, rails, document) { | |
"use strict"; | |
var PromptUpdate = { | |
defaults: { name: 'value', method: 'put' }, |
#!/usr/bin/env ruby | |
require 'open-uri' | |
how_many = ARGV.pop || 10 | |
how_many = how_many.to_i | |
module Prime | |
def self.take(count) | |
search_space = 2..count**2 | |
search_space.select { |x| is_prime?(x) }.take(count) |
sudo yum -y install glibc-static | |
export DESTDIR="/tmp/runit_installdir" | |
rm -rf $DESTDIR | |
mkdir $DESTDIR | |
cd $DESTDIR | |
mkdir -p ./package ./service ./sbin ./usr/local/bin ./etc/init | |
echo -e """# for runit - manage /usr/sbin/runsvdir-start |
cd ~/ | |
wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz | |
tar xzf proj-4.8.0.tar.gz | |
cd proj-4.8.0 | |
./configure --prefix=/usr | |
make | |
mkdir /tmp/installdir | |
make install DESTDIR=/tmp/installdir | |
cd ~/ | |
fpm -s dir -t rpm --name proj --version 4.8.0 --verbose -C /tmp/installdir ./usr |
class ForComp | |
def initialize(*args) | |
if args.first.is_a? Hash | |
@context = Struct.new(*args.first.keys) | |
end | |
vars = args.first.is_a?(Hash) ? args.first.values : args | |
enum = init_enum(vars.shift) | |
@enumerator = vars.inject(enum) do |enum, var| |
class MultiLogger | |
attr_reader :level | |
def initialize(args={}) | |
@level = args[:level] || Logger::Severity::DEBUG | |
@loggers = [] | |
Array(args[:loggers]).each { |logger| add_logger(logger) } | |
end |
:setlocal spell spelllang=en_gb
]s
Search Forward
]s
Search Backward
z=
Suggest Corrections
class EntityController < ApplicationController | |
respond_to :json | |
def create | |
entity = Entity.new(post_params) | |
validator = EntityValidator.new(entity) | |
if validator.passes? | |
collection = EntityRepository.add(entity) | |
respond_with EntityPresenter.new(entity) |
source :rubygems | |
gem 'rubberband' | |
gem 'yajl-ruby' |