Skip to content

Instantly share code, notes, and snippets.

View DenKey's full-sized avatar
:shipit:

Den DenKey

:shipit:
  • Ukraine
  • 13:32 (UTC +03:00)
View GitHub Profile
class FileException < Exception
end
# Connection client
class ConnectionClient
CLIENT_URL = 'https://our-system.com/connections'.freeze
attr_reader :conn
def initialize(_options)
def attributes_to_str(attrs)
return nil unless attrs.kind_of?(Hash)
attrs.map {|k,v| k + ' = ' + v}.join(',')
end
def build(attrs)
<<-QUERY
UPDATE Customers
SET #{attributes_to_str(attrs)}
@DenKey
DenKey / quicksort.rb
Last active November 8, 2023 18:28
Quicksort
def quicksort(array)
if array.size < 2
return array
else
pivot = array[0]
less = array[1..-1].filter {|item| item <= pivot }
greater = array[1..-1].filter {|item| item > pivot}
return quicksort(less) + pivot + quicksort(greater)
end
end

Technologies you should know

Ruby developer short list

  • Ruby
    • Bundler
    • Pry
    • Pry-byebug
    • awesome_print
    • Sidekiq/Resque
  • Rspec
@DenKey
DenKey / .vimrc
Last active February 4, 2018 20:57
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'morhetz/gruvbox'
" Initialize plugin system
call plug#end()
syntax on
colorscheme gruvbox
set background=dark
set number
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "fnando/hellobits-trusty64"