Skip to content

Instantly share code, notes, and snippets.

View foxweb's full-sized avatar
🏠
Working from home

Aleksey Kurepin foxweb

🏠
Working from home
View GitHub Profile
rake aborted!
ActiveAdmin::DatabaseHitDuringLoad: Your file, app/models/subscription_type.rb (line 22), caused a database error while Active Admin was loading. This is most common when your database is missing or doesn't have the latest migrations applied. To prevent this error, move the code to a place where it will only be run when a page is rendered. One solution can be, to wrap the query in a Proc.Original error message: PG::UndefinedTable: ERROR: relation "subscription_types" does not exist
LINE 5: WHERE a.attrelid = '"subscription_types"'::re...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"subscription_types"'::regclass
AND a.attnum > 0 AND NOT a.attis
traceroute: Warning: www.flickr.com has multiple addresses; using 188.125.93.39
traceroute to flickr-panda-police.a00.yahoodns.net (188.125.93.39), 64 hops max, 52 byte packets
1 10.167.83.241 (10.167.83.241) 2.211 ms 1.646 ms 1.577 ms
2 lynx.imedia.ru (10.167.0.254) 0.346 ms 0.341 ms 0.386 ms
3 asr1001-0.imedia.ru (91.230.26.222) 1.307 ms 1.079 ms 1.072 ms
4 83.242.160.217 (83.242.160.217) 1.432 ms 1.649 ms 1.493 ms
5 a197-cr04-be6.77.msk.stream-internet.net (195.34.59.13) 2.921 ms 2.042 ms 3.471 ms
6 a197-cr04-be6.101.msk.stream-internet.net (212.188.55.2) 1.959 ms * 1.496 ms
7 a197-cr03-ae3.10.msk.stream-internet.net (195.34.49.113) 1.499 ms 1.510 ms *
8 a197-cr04-be19.10.msk.stream-internet.net (212.188.55.25) 43.745 ms 44.104 ms 43.927 ms
ru:
spree:
master: Master
prices: Цены
show_currency_selector: Показывать переключатель валюты
supported_currencies: Поддерживаемые валюты
allow_currency_change: Разрешить смену валюты
variant_prices_search_placeholder: Искать по коду SKU или названию
notice:
prices_saved: Цены успешно сохранены
a = [1, 3, 5, 7, 9, 11, 13, 15]; a.each{|x| puts "x = #{x}"; a.each{|y| puts "y = #{y}"; a.each{|z| puts "#{x} + #{y} + #{z} = #{x+y+z}" } } }
//Sample using LiquidCrystal library
#include <LiquidCrystal.h>
/*******************************************************
This program will test the LCD panel and the buttons
Mark Bramwell, July 2010
********************************************************/
types = %w(people companies places events type1 type2 type3 type4 type5 type6)
positions =* (1..10)
Document.all.each do |document|
puts 'Document GID: ' + document.gid.to_s
positions.each do |position|
tagging = Tagging.create do |tagging|
tagging.document_gid = document.gid
tagging.type = types.sample
hash = {
topics: "quod",
page: "omnis",
rubrics: {
russia: {
tags: [
"at",
"et"
]
},
0.01 14.972 0.038 0.000 14.934 11461 *ActiveSupport::Callbacks::Filters::End#call
0.01 0.044 0.037 0.000 0.007 8974 Time#strftime
0.01 14.823 0.037 0.000 14.785 8974 *ActiveRecord::Timestamp#create_record
0.01 1.582 0.037 0.000 1.545 8974 ActiveSupport::TimeWithZone#respond_to_missing?
0.01 4.352 0.037 0.000 4.315 10000 ActiveRecord::ConnectionAdapters::OpenTransaction#commit
0.01 0.558 0.037 0.000 0.521 4487 Arel::Visitors::ToSql#visit_Arel_Nodes_InsertStatement
0.01 0.282 0.037 0.000 0.245 8974 TZInfo::TimeOrDateTime#+
0.01 0.500 0.036 0.000 0.464 4487 ActiveModel::Validations#valid?
0.01 0.056 0.036 0.000 0.020 26922 Time#nsec
0.01 0.183 0.036 0.000 0.148 7 <Module::Kernel>#load
# Класс создатель объектов Url и связанных сущностей.
class UrlCreator
attr_reader :url
# Инициирует модель Url на основе полного URL.
#
# @param [String] full_url какой-то URL (http://www.linux.org.ru/forum/talks/8623652)
#
def initialize(full_url)
@url = URI.parse(full_url)
# create_table :domains, force: true do |t|
# t.string :slug, null: false
# t.integer :path, default: [], null: false, array: true
# t.datetime :created_at
# t.datetime :updated_at
# end
#
# add_index :domains, [:slug, :path], name: :index_domains_on_slug_and_path, unique: true, using: :btree
class Domain < ActiveRecord::Base