This file contains hidden or 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
arr = ['Эспоркам', 'Лаваж Маткевича', 'дермазол мазь', 'фуродолизон', 'Мазь от ворикоза', 'литолизин', 'Дженерик-левитра', 'бесопролол тева', 'вальпорат', 'Гестомакс', 'вазобра', 'деметилсулбфаксид', 'Неметалла', 'Иглы ново фвйн', 'фиксир', 'дипросалик 30', 'Бозирон ас 2', 'Дешёвый аналог тиаксевазин', 'воловир', 'де нол', 'Лориста,', 'Иикролакс', 'Тест-полоски ван тач ультра', 'testests', 'Йодомарин', 'Shop', 'Гексенал', 'Димексида', 'Корвамин', 'Марганцовокислый', 'ХлорофилиптХло', 'катария', 'Гептопюр', 'Метабалаза', 'изикар', 'ля рош spf', 'Телиста', 'спироналактон 50мг', 'канимицин', 'подмышечники', 'крем от солнеца', 'ксалинол гель', 'антибиотик капли', 'jrjvbwby', 'Масопатийный сбор', 'bioretin', 'шампунь кофеин', 'afcnev', 'бифидум бик', 'ОРУНГОМИН', 'Non stop', 'Биоойл масло', 'Целеконивее подушечки между пальцам', 'бензимидазолы', 'Солнцезащитный флюид', 'валидол в таблетках', 'Юниобин', 'мильдронат', 'голова', 'Бронхол', 'Витамин B 12', 'ESTHETIC HOU', 'Ацикловир ахрихин', 'Эдас 101', '95804385 |
This file contains hidden or 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
{ | |
"comments":[ | |
{ | |
"id": 1, | |
"body": "comment 1", | |
"likes": [ | |
{ | |
"id": 1, | |
"user": { | |
"id": 11, |
This file contains hidden or 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
server { | |
valid_referers none blocked frontend.yourdomain.com *.frontend.yourdomain.com; | |
if ($invalid_referer) { | |
return 403; | |
} | |
map $http_x_project_private $prevent_hack { | |
default "1"; | |
'SecretHeader' "0"; |
This file contains hidden or 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
if (-f /projects/abc/public/maintenance.html) { | |
return 503; | |
} | |
error_page 503 @maintenance; | |
location @maintenance { | |
root /projects/abc/public; | |
rewrite ^(.*)$ /maintenance.html break; | |
} |
This file contains hidden or 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
[program:puma-dev] | |
command=/usr/local/rvm/gems/ruby-2.2.0/bin/puma -b unix:///tmp/meetplay-dev.sock -e development -t 2:8 | |
process_name=%(program_name)s | |
numprocs=1 | |
directory=/home/dg/projects/meetplay | |
umask=022 | |
priority=999 | |
autostart=true | |
autorestart=unexpected | |
startsecs=10 |
This file contains hidden or 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
def initialize | |
@events = {} | |
ActiveSupport::Notifications.subscribe do |*args| | |
event_name = args[0] | |
payload = args[4] | |
@events[event_name] = {} if @events[event_name].nil? | |
@events[event_name]['pointer'] = 0 if @events[event_name]['pointer'].nil? | |
@events[event_name]['history'] = [] if @events[event_name]['history'].nil? |
This file contains hidden or 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
PS1='\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] ' |
This file contains hidden or 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
<%= time_zone_select(:user, :time_zone, nil, { model: TZInfo::Timezone, default: 'Europe/Moscow' } ) %> |
This file contains hidden or 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
attr_accessor :current_user | |
def serializable_hash(options={}) | |
options = {} if options.nil? | |
self.current_user = options[:user] | |
options[:methods] ||= [ :participated_friends_ids ] | |
super(options) | |
end | |
def participated_friends_ids(user = self.current_user) |
This file contains hidden or 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
module UrlSanitizer | |
extend ActiveSupport::Concern | |
require 'uri' | |
# this concern creates a 'virtual' method, for example 'site_url=(arg)', | |
# which validates and sanitizes url by metaprogramming magic | |
# usage in model: | |
# include UrlSanitizer |