Skip to content

Instantly share code, notes, and snippets.

Aleksey Ivanov ivanovaleksey

Block or report user

Report or block ivanovaleksey

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sheety.rb
require 'axlsx'
require 'batch_factory'
def off_balance?(count)
!(count =~ /^0\d\d/).nil? || !(count =~ /^\D/).nil?
keys = [:code, :name, :sub1, :sub2, :sub3]
skk = BatchFactory.from_file('skk.xlsx', keys: keys).drop(1)
View postgres aliases
# make_dump(){
# now=$(date +"%Y%m%d")
# pg_dump -Fc -U deployer -w mercury_production -f ~/manual_dumps/mercury_sa_$now.dump
# }
if [[ -z $1 ]]; then
echo Database is not specified
return 0
View xpath-cheatsheet.js
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// 0. XPath Examples.
// More:
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
View Capfile.rb
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks
View date_scopes.rb
module DateScopes
extend ActiveSupport::Concern
module ClassMethods
def define_date_scopes(*scope_columns) do |column|
match_data = column.match(/^(.*)_at$/)
name = match_data ? match_data[1] : column
You can’t perform that action at this time.