Skip to content

Instantly share code, notes, and snippets.

View reabiliti's full-sized avatar
🏠
Working at home

Aleksandr Dyuzhikov reabiliti

🏠
Working at home
  • skype: reabiliti
  • Krasnodar, Russia
View GitHub Profile
@reabiliti
reabiliti / deep_include_matcher.rb
Last active April 21, 2020 15:15 — forked from mltsy/deep_include_matcher.rb
RSpec deep include matcher for nested hashes (ignores order and extra keys/values)
# frozen_string_literal: true
RSpec::Matchers.define(:deep_include) do |expected|
# Found there https://gist.github.com/mltsy/21fd5e15ae12a004c8b13d6ec4534458 and added some changes
# For example we have some spec:
# expect(query_result).to deep_include(
# tickets: {
# edges: [
# {
# node: {
@reabiliti
reabiliti / helper-Strings.js
Created November 1, 2019 10:36 — forked from ruslankonev/helper-Strings.js
JS toCamel, trim, toDash, toUnderscore, capitalize, decapitalize, blankLink, parseURL
String.prototype.toCamel = function(){
return this.replace(/([-_][a-z])/g, function($1){return $1.toUpperCase().replace(/[-_]/,'');});
};
String.prototype.trim = function(){
return this.replace(/^\s+|\s+$/g, "");
};
String.prototype.toDash = function(){
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,
@reabiliti
reabiliti / Readme.md
Last active February 12, 2020 12:23 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 19.04
wget https://gist.githubusercontent.com/reabiliti/92e2533335e784099e5bdc39d48fbb46/raw/ff10e54f562c83672f0b1958a144c4b72c070158/install-selenium.sh
chmod +x install-selenium.sh
./install-selenium.sh

wget https://gist.githubusercontent.com/reabiliti/92e2533335e784099e5bdc39d48fbb46/raw/ada2df9aa38a825e8e3058ec49708444c5a04510/start-chrome.sh
chmod +x start-chrome.sh
./start-chrome.sh
@reabiliti
reabiliti / books_list.txt
Created September 17, 2018 02:57 — forked from fedorkk/books_list.txt
Список книг для обучения
Алгоритмы:
1) Стивен Скиена "Алгоритмы. Руководство по разработке"
2) Томас Кормен "Алгоритмы. Построение и анализ"
3) Дональд Кнут "Искусство программирования" (никто в реальности не читал этот многотомный труд целиком, но в любой подборке по алгоритмам он обязан быть)
Общее:
1) Род Хаггарти "Дискретная математика для программистов"
2) Керниган, Ритчи "Язык программирования С" - для общего понимания принципов программирования
3) Дж. Андресон "Дискретная математика и комбинаторика"
4) Романовский И.В. "Дискретный анализ"
##
# by SoAwesomeMan
str =<<-EOS.gsub(/^[\s\t]*|[\s\t]*\n/, '') # no space "\s" for new line "\n"; kill tabs too
select awesome, awesome, awesome, awesome, awesome, awesome,
from rad, rad, rad, rad, rad, rad, rad, rad, rad, rad, rad,
where cool cool cool cool cool cool cool cool cool cool cool'
EOS
# => "select awesome, awesome, awesome, awesome, awesome, awesome,from rad, rad, rad, rad, rad, rad, rad, rad, rad, rad, rad,where cool cool cool cool cool cool cool cool cool cool cool'"
str =<<-EOS.gsub(/^[\s\t]*/, '').gsub(/[\s\t]*\n/, ' ').strip # yes space "\s" for new line "\n"; kill tabs too
@reabiliti
reabiliti / sidekiq.service
Last active April 14, 2022 18:27 — forked from mkhuda/sidekiq.service
Sidekiq service auto start for Ubuntu 18.04 using Systemd
#
# Sidekiq auto start using systemd unit file for Ubuntu 18.04
#
# Put this in /lib/systemd/system (Ubuntu).
# Run:
# 1. systemctl enable sidekiq (to enable sidekiq service)
# 2. systemctl {start,stop,restart} sidekiq (to start sidekiq service)
#
# This file corresponds to a single Sidekiq process. Add multiple copies
# to run multiple processes (sidekiq-1, sidekiq-2, etc).
@reabiliti
reabiliti / sources.list
Created August 30, 2018 00:28
Ubuntu 18.04 Bionic default /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@reabiliti
reabiliti / example_activejob.rb
Created August 17, 2018 13:56 — forked from ChuckJHardy/example_activejob.rb
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end