This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Входит Вика. | |
Вика: Hi all! Im Vikky 17/f bi. Anybody wanna sex? | |
Hикто не отвечает. Все заняты своими делами. | |
Входит Анна. | |
Анна: Privet. Kto nibud govorit po russki? | |
Вика: anna privet. ti otkuda? | |
Анна: Iz moskvi, a ti? | |
Вика: ya tozhe. u tebja russkij shrift est? | |
Анна: da | |
Вика: ЧПФ ФБЛ РТПЮЙФБФШ HПЦЕЫШ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#model/article.rb | |
class Article | |
include DataMapper::Resource | |
property :id, Integer, :serial => true | |
property :title, String, :nullable => false | |
property :body, Text | |
property :created_at, DateTime | |
property :updated_at, DateTime | |
default_scope(:default).update(:order => [:created_at.desc]) | |
# DataMapper.auto_upgrade! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Good < ActiveRecord::Base | |
has_many :good_tags | |
has_many :tags, through: :good_tags | |
end | |
class GoodTag < ActiveRecord::Base | |
belongs_to :good | |
belongs_to :tag | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
анализатор | |
analysis: { | |
filter: { | |
filter_special_symbol: { | |
type: "pattern_replace", | |
pattern: "\W()|_-$%^&*.,<>", | |
replacement: "" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mysql2' | |
require 'sequel' | |
names = File.read('somefile').split('\r\n').map(&:strip) | |
db = Sequel.connect("mysql://username:password@localhost:3306/dbname") | |
db[:resume].join_table(:left, :user, :id=>:parent).where(name: names).to_a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /garagetools-development-products/_search | |
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"bool": { | |
"should": [ | |
{ | |
"prefix": { | |
"sku": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.require | |
Sequel.connect("sqlite3://development.sqlite3") | |
Sequel::Model.plugin :json_serializer | |
class Post < Sequel::Model | |
plugin :json_serializer | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
module MyApp | |
class API < Sinatra::Base | |
content_type :json | |
Report.all.to_json | |
end | |
class Admin < Sinatra::Base | |
use SinatraAdmin::App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en: | |
activerecord: | |
errors: | |
messages: | |
taken: 'has already been taken' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
chdir: /home/deployer/sinatraapp/ | |
environment: production | |
timeout: 30 | |
log: /home/deployer/sinatraapp/log/thin.log | |
pid: /home/deployer/sinatraapp/tmp/pids/thin.pid | |
socket: /home/deployer/sinatraapp/tmp/sockets/thin.sock | |
max_conns: 1024 | |
max_persistent_conns: 10 | |
require: [] |
OlderNewer