Skip to content

Instantly share code, notes, and snippets.

View kkuprikov's full-sized avatar

Kirill Kuprikov kkuprikov

View GitHub Profile
def import_from_csv
existing_with_another_tn = []
correct_users = []
staffing_item_not_found = []
extra = []
total_count = 0
CSV.read('./func_import_delim.csv').each do |row|
tn = row[0]
name = row[1]
staffing_item_id = row[2]
require 'axlsx'
package = Axlsx::Package.new
package.workbook do |workbook|
workbook.add_worksheet name: 'merged_cells' do |sheet|
sheet.add_row %w(a b c d e f g)
sheet.add_row %w(b c d x y z z)
sheet.merge_cells "A1:A2"
sheet.merge_cells "B1:B2"
123
#!/usr/bin/env ruby
require 'json'
require 'pry'
url = "rtmp://fms.105.net/live/rmc1"
BITS_IN_BYTE = 8
BYTES_IN_KB = 1024
def compute_data type: 'video', frames: 1000, url:
def foobar n=100
(1..n).each do |i|
output = "#{'Hi' if i % 3 == 0}#{'By' if i % 5 == 0}"
output = i.to_s if output.empty?
puts output
end
end
def swapcase str
str.chars.map{ |c| c == c.downcase ? c.upcase : c.downcase }.join