Skip to content

Instantly share code, notes, and snippets.

View isqad's full-sized avatar
:shipit:
Working from home

Andy0x58 isqad

:shipit:
Working from home
  • Ekaterinburg, Russia
  • 22:06 (UTC +05:00)
View GitHub Profile
@isqad
isqad / tmux-cheatsheet.markdown
Created February 2, 2017 14:59 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@isqad
isqad / qreplay.py
Created January 25, 2017 21:28 — forked from tomatolog/qreplay.py
import os, sys, base64, select, socket, struct, datetime, time, traceback
host_all = '127.0.0.1'
port_sql = 0
port_api = 0
packet_max_len = 16384
verbose = 0
debug = 0
banner_ql = '--- crashed SphinxQL request dump ---'
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master
for p in rvm-patchsets/patches/ruby/1.9.3/p551/railsexpress/* ; do
patch -p1 < $p
done
}
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p551" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.gz" patch_ruby_railsexpress autoconf standard
company_id = 11973147
wrong_field = :active_reviews_count
# before
CoreDenormalization::Fields::Company::Reviews.value_as_string(object: company_id, field: wrong_field)
sql_for_data = initialize_statement # with company_id filter
data = ActiveRecord::Base.connection.execute sql_for_data
hash_with_object_key = {data.delete(:object_id) => data}
CoreDenormalization::Fields::Company::Reviews.instance.write_data hash_with_object_key
@isqad
isqad / Gemfile
Last active August 29, 2015 14:20 — forked from yuki24/Gemfile
source 'https://rubygems.org'
gem 'benchmark-ips'
gem 'activesupport'
gem 'jbuilder'
gem 'rabl'
gem 'oj'