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 / ruby_ipoval
Created June 20, 2011 07:40
ruby_ipoval
# http://hyperpolyglot.org/scripting
$? # global Process::Status object; system('date'); $?.exitstatus;
$ ruby -cw filename.rb # checks the code in the file for syntax errors
$ ruby -e '1/0' # one-liner ruby executable
`gem environment gemdir`
@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 / README.md
Last active December 20, 2015 22:19
Add a custom method definition to Test Blueprints in Machinist::Mongoid. It is very handy in the tests to have extra helper methods directly on the Test Blueprints without defining those in the corresponding Model class.

INSTALLATION

echo "gem 'machinist_blueprint_with_method',\
      git: 'git://gist.github.com/6204150.git',\
      group: 'test'" >> Gemfile

EXAMPLE OF USAGE

@ipoval
ipoval / rails_find_unused_partials.sh
Last active November 11, 2015 19:07
find_unused_partials_in_views.sh
ruby -e "
'`find ./app/views -name _*`'
.split
.map { |f| f.split('/').last[1..-1][/[^\.]+/] }
.each { |f| system( %Q(fgrep -rq #{f} ./app/views/) ) ? nil : p(f) }
"