Skip to content

Instantly share code, notes, and snippets.

View pruchai's full-sized avatar

Igor Pruchanskiy pruchai

View GitHub Profile
@pruchai
pruchai / logr.bash
Created November 19, 2020 19:37 — forked from ttscoff/logr.bash
Bash logging utility that simplifies use of logger command
#!/bin/bash
# Logging utility that simplifies user of bash logger command
# # First source the script
# source ~/scripts/logr.bash
# # Start the logger, generates log name from scripts filename
# logr start
# # or define your own
# logr start LOG_NAME
@pruchai
pruchai / active_record_master.rb
Last active August 29, 2015 14:14
Failure demonstration
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@pruchai
pruchai / active_record_master.rb
Last active August 29, 2015 14:14
ActiveRecord test
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@pruchai
pruchai / 1.rake
Last active August 29, 2015 14:14
Rake task to demonstrate failure to update a record
namespace :post do
desc "Test Post"
task :nested_test => :environment do
def contact_params
params = {
:id => '1',
:contact_name => 'joe-user',
:host_notification_commands_attributes => {