Skip to content

Instantly share code, notes, and snippets.

View ipoval's full-sized avatar

ipoval ipoval

  • Microsoft, Atlassian
  • Sydney, Australia
View GitHub Profile
var dbGroups = [
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Throughput")`).parents('li.dashboard-group'),
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Performance")`).parents('li.dashboard-group'),
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Latency")`).parents('li.dashboard-group'),
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Screenboard Group")`).parents('li.dashboard-group'),
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Saturation")`).parents('li.dashboard-group'),
$(`.dashboard-group-list ul.dashboard-groups li.dashboard-group .dashboard-group-name a.anchor-text:contains("JSRE TF - Healthcheck")`).parents('li.dashbo
@ipoval
ipoval / ansible-summary.md
Created March 10, 2018 10:37 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@ipoval
ipoval / mcrouter on alpione
Created February 22, 2017 03:11
mcrouter on alpione
Install stuff from here:
https://wiki.alpinelinux.org/wiki/How_to_get_regular_stuff_working
apk add --no-cache linux-headers
apk add --no-cache jemalloc-dev
apk add --no-cache boost-thread
apk add --no-cache boost-dev
apk add --no-cache boost-filesystem
apk add --no-cache boost-program_options
apk add --no-cache boost-regex
Upgrading Rails 3.2.12.2 to Rails 4.1.15
git fetch origin rails_4
git checkout -b rails_4 FETCH_HEAD
rails_4 branch is rebased often, so git branch -D rails_4; git pull origin rails_4
MAIN AREAS OF WORK
- everything that has `# FIXME: rails4` comment line in this PR needs to be fixed for `rails_4` branch
- if possible the fix should be applied in `master` branch first, and `rails_4` branch rebased on top of `master`
@ipoval
ipoval / angulajs_js_dp.js
Created May 31, 2016 04:28
angulajs_js_dp.js
// ANGULAR JS
// JAVASCRIPT DESIGN PATTERNS EXAMPLES
https://plnkr.co/edit/V1WmNSxRD28nXJIfGcpf?p=preview
@ipoval
ipoval / rails_3_to_4_routes_changes.rb
Created January 28, 2016 22:01
rails_3_to_4_routes_changes.rb
nl -ba config/routes/api_v1.rb | grep -v via | grep match | awk '{print $1}' | pbcopy
a = [43, 46, 50, 51, 54, 55]
File.open('config/routes/api_v1.rb') do |f|
lines = f.readlines
lines.each_with_index do |line, idx|
if a.include?(idx + 1)
lines[idx] = line.sub('match', 'get')
lines[idx] = lines[idx].rstrip + ' # FIXME: rails4' + "\n"
@ipoval
ipoval / rails_setup.rb
Created December 29, 2015 19:44
RAILS SETUP
#!/usr/bin/env ruby
# bin/setup
require "pathname"
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__) # path to your application root.
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application. Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
@ipoval
ipoval / unix_ipc.rb
Created September 25, 2015 04:34
Inter-process communication in UNIX
# IPC 1 - IO.pipe to set up the UNIX-pipe-based interprocess communication
in_r, in_w = IO.pipe; out_r, out_w = IO.pipe; err_r, err_w = IO.pipe
pid = spawn('cat -n', in: in_r, out: out_w, err: err_w)
[in_r, out_w, err_w].each(&:close)
in_w.puts("signal to process")
in_w.close
@ipoval
ipoval / rails_unicorn_start_fg.bash
Created July 26, 2015 18:08
start rails unicorn web server in foreground
#!/usr/bin/env bash
# Run unicorn in the foreground and customize how it runs.
#
# Usage: ./script/start_rails_fg.bash
# ./script/start_rails_fg.bash --help
# supports these env variables: UNICORN_PID
# UNICORN_LISTEN
# UNICORN_STDERR_PATH
# UNICORN_STDOUT_PATH
@ipoval
ipoval / rails_find_unused_model.bash
Last active November 11, 2015 19:07
rails find unused model
#
find app/models/ -name "*.rb" | xargs grep -h --color -e ^class | cut -d ' ' -f 2 | sort | uniq | while read k; do echo model class: "$k"; grep -r -l -w -m 1 --color "$k" ./app ./config ./lib ./script --exclude-dir=*assets* | head -n 2 | wc -l | grep 1; done