Skip to content

Instantly share code, notes, and snippets.

View dapi's full-sized avatar
🌴
Open for offers

Danil Pismenny dapi

🌴
Open for offers
View GitHub Profile
# Это такой замысловатый спосбо добавить поддомен в запрос для rspec
#
# Использовать:
#
# RSpec.configure do |config|
# config.include ProcessWithRequestSubdomain, type: :controller
#
module ProcessWithRequestSubdomain
extend ActiveSupport::Concern
@dapi
dapi / request_with_subdomain.rb
Last active December 10, 2019 07:26
Add request subdomain for rspec
# Это такой замысловатый спосбо добавить поддомен в запрос для rspec
#
# Использовать:
#
# RSpec.configure do |config|
# config.include ProcessWithRequestSubdomain, type: :controller
#
module ProcessWithRequestSubdomain
extend ActiveSupport::Concern
@dapi
dapi / flash.coffee
Last active December 10, 2019 07:28
# Author: Danil Pismenny https://github.com/dapi
#
# Install:
#
# add gem 'rails-assets-noty' with source 'https://rails-assets.org'
#
# Usage:
#
# window.Flash.show('error', 'message')
#
@dapi
dapi / ya_counter_finder.js
Last active December 10, 2019 07:28
Находит наименование первого яндекс счетчика установленного на сайте через JavaScript
Object.getOwnPropertyNames( window ).find(function(str) { return str.includes('yaCounter'); })
@dapi
dapi / invoice.pdf.erb
Created July 26, 2019 15:26
Invoce PDF
<!doctype html>
<html>
<head>
<meta charset='utf-8' />
<style>
body {
font-size: 12px;
}
table {
border-collapse: collapse;
@dapi
dapi / kill_springs.sh
Created August 2, 2019 13:37
Kill hanged ruby spring servers
#!/usr/bin/env
echo "Kill them all!!!"
ps axfww | grep spring | grep "app\|server" | awk '{ print $1 }' | xargs kill -9
@dapi
dapi / paraquest-arrow-editor.js
Last active October 23, 2019 10:37
Проверять тут - http://sketch.paperjs.org/
var title = new PointText(new Point(200, 10));
title.content="click - установка стрелки, drug - перемещени, shift-drug - вращение"
var debug = new PointText(new Point(200, 50));
var currentArrow;
var raster = new Raster({
source: "https://paraquest.ru/uploads/slide/image/20/2018-11-12_21_10_04-Улет_с_Аламнера3.png",
position: view.center
});
https://<%= domain %>:444 https://*.<%= domain %>:444 {
log /home/wwwkiiiosk/kiiiosk.store/shared/log/<%= domain %>_access.log
errors /home/wwwkiiiosk/kiiiosk.store/shared/log/<%= domain %>_error.log
gzip
tls <%= cert_file %> <%= key_file %> {
max_certs 2
}
@dapi
dapi / response.json
Created February 10, 2020 06:19
promelec invalid json
{"item_id": 114523, "name": "ШР20П5НШ10 розетка", "producer_name": "Элекон", "remark": ""1"", "sort_name": "ШР20П5НШ10 РОЗЕТКА", "quant": 182, "year_of_issue": "2018", "description": "кабельная розетка", "pack_quant": 32, "packaging": "Bulk (россыпь)", "class0_id": 406, "class1_id": 1203, "class2_id": 1204, "class0name": "Разъемы, Соединители", "class1name": "Цилиндрические, круглые разъемы", "class2name": "Крупногаба
ритные разъемы", "rkg": "8 1 1", "date_time": "10.02.2020 11:15:47", "price_unit": 1, "datasheet": "https://office.promelec.ru/upload/datasheet/7/7/shr.pdf", "photo_url": "https://office.promelec.ru/upload/items/2017/05/02/114523.jpg", "weight": 60.3, "moq": 1, "pricebreaks": [{"quant": 1, "price": 588.00, "pureprice": 662.32},{"quant": 3, "price": 546.79, "pureprice": 618.94},{"quant": 6, "price": 522.69, "pureprice": 575.57},{"quant": 11, "price": 506.84, "pureprice": 550.20},{"quant": 22, "price": 506.84, "pureprice": 532.18}]}]
Mar 28 06:25:01 helga rsyslogd: [origin software="rsyslogd" swVersion="8.32.0" x-pid="980" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Mar 28 07:00:11 helga smartd[987]: Device: /dev/sda [SAT], self-test in progress, 60% remaining
Mar 28 07:00:11 helga smartd[987]: Device: /dev/sdb [SAT], self-test in progress, 60% remaining
Mar 28 07:17:01 helga CRON[7955]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Mar 28 07:30:11 helga smartd[987]: Device: /dev/sdb [SAT], SMART Usage Attribute: 194 Temperature_Celsius changed from 193 to 187
Mar 28 08:15:29 helga systemd-resolved[894]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Mar 28 08:15:29 helga postfix/smtpd[10027]: connect from unknown[45.143.222.183]
Mar 28 08:15:29 helga postfix/smtpd[10027]: NOQUEUE: reject: RCPT from unknown[45.143.222.183]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> prot