- rails new memeorama
- rails server
- rails generate scaffold meme name:string description:text picture:string
| "one" | |
| "two" | |
| "three" | |
| "four" | |
| "five" | |
| "six" | |
| "seven" | |
| "eight" | |
| "nine" | |
| "ten" |
| [10:43] arkham ~/code/vintage-contemporaneo [2.0.0-p0] (master) | |
| ↳ $ rspec spec/models/admin_user_spec.rb | |
| /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- activeadmin-gallery (LoadError) | |
| from /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' | |
| from /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require' | |
| from /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency' | |
| from /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require' | |
| from /Users/arkham/code/vintage-contemporaneo/spec/model_spec_helper.rb:11:in `<top (required)>' | |
| from /Users/arkham/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45 |
| module ActiveAdmin | |
| module Views | |
| class PaginatedCollection < ActiveAdmin::Component | |
| protected | |
| def build_pagination_with_formats(options) | |
| div :id => "index_footer" do | |
| build_pagination | |
| div(page_entries_info(options).html_safe, :class => "pagination_information") |
| class SearchPlaces | |
| include ActiveModel::Validations | |
| include ActiveModel::Conversion | |
| extend ActiveModel::Naming | |
| attr_accessor :lat, :lng, :distance, :address | |
| attr_accessor :query | |
| attr_accessor :type_id | |
| attr_accessor :category_id |
| #! /bin/bash | |
| set -e | |
| DIR=${1:-.} | |
| PRUNED_CHARS=":?" | |
| find $DIR -type f -print | while read filename | |
| do | |
| cleaned=${filename//[$PRUNED_CHARS]/} |
| -module(calc). | |
| -export([rpn/1, rpn_test/0]). | |
| rpn(L) when is_list(L) -> | |
| [Result] = lists:foldl(fun rpn/2, [], string:tokens(L, " ")), | |
| Result. | |
| read(Val) -> | |
| case string:to_float(Val) of | |
| {error, no_float} -> list_to_integer(Val); |
| WITH RECURSIVE friendship_tree(id, name, path) AS ( | |
| SELECT id, name, ARRAY[id] | |
| FROM members | |
| WHERE members.h1 LIKE '%Cortina%' | |
| UNION ALL | |
| SELECT members.id, members.name, path || members.id | |
| FROM friendship_tree | |
| JOIN friendships ON friendships.friend_id = friendship_tree.id | |
| JOIN members ON members.id = friendships.member_id | |
| WHERE NOT members.id = ANY(path) |
| function! ConvertShouldToExpect() | |
| let rspec_conversions = { | |
| \ 'should': 'to', | |
| \ 'should_not': 'not_to', | |
| \ 'should_receive': 'to receive', | |
| \ 'should_not_receive': 'not_to receive', | |
| \ } | |
| for [old, new] in items(rspec_conversions) | |
| execute "normal! " . ':%s/\v^(\s+)(.+)\.' . old . '>/\1expect(\2).' . new . '/ge' . "\<CR>" |