Skip to content

Instantly share code, notes, and snippets.


Valeriy Sizov vsizov

View GitHub Profile

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

vsizov / tmux.conf
Created Nov 29, 2016 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
vsizov /
Last active Dec 25, 2015 — forked from sleistner/
Remove all remote and local branches except master and next
git branch -d -r `git branch -r | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'`
git branch -D `git branch | awk '{ if ($0 !~ /next|master/) printf "%s", $0 }'`
vsizov / gist:9247282
Last active Dec 25, 2015 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
View gist:9247282
$ git branch -r --merged origin/master |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
View gist:8956013
drop table if exists secured_data;
--For secured payments:
into temp secured_data
FROM customers c
JOIN loans l ON = l.customer_id
JOIN loan_tasks_committed lt on lt.loan_id =
AND lt.loan_task_cd in ('payoff_loan_task','payoff_instl_task')
JOIN payment_transactions_committed pt on pt.loan_task_committed_id =
View gist:7706718
select f.*, count(*) cnt
from feedbacks f
LEFT JOIN feedbacks fn ON = (SELECT MAX(id) FROM feedbacks WHERE customer_id = f.customer_id)
WHERE (f.comment IS NOT NULL OR f.testimonial IS NOT NULL) AND f.company_id = 42
GROUP BY f.recommend;
View LastPayReport.rb
class LastPayReport
def initialize employees
@employees = employees
def get_rows do |employee|
View gist:6411954
class UsersField < ActiveRecord::Base
belongs_to :user
belongs_to :field
has_one :fields_group, through: :field
validates :value, allow_blank: true
def create_record
if !self.field.required & self.value.blank?
View dynamic_form_for_hstore_attributes_in_rails.html.erb
<%= simple_form_for @product do |f| %>
<%= f.simple_fields_for :attributes do |d| %>
<% f.object.attributes.try(:each) do |key, value| %>
<%= d.input key, :input_html => {:value => value } %>
<% end %>
<% end %>
<% end %>
View gist:5320207
Exception in thread "main" java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at no.priv.garshol.duke.datasources.JDBCDataSource.getRecords(
at no.priv.garshol.duke.Processor.index(
at no.priv.garshol.duke.Duke.main_(
at no.priv.garshol.duke.Duke.main(
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
You can’t perform that action at this time.