Skip to content

Instantly share code, notes, and snippets.

View vovayartsev's full-sized avatar

Vladimir Yartsev vovayartsev

View GitHub Profile
class Meeting < ActiveRecord::Base
serialize :metadata, MeetingMetadata::Coder
end
@vovayartsev
vovayartsev / cancan_issue_691
Created July 14, 2013 20:06
Test for CanCan issue #691
Test
web: bin/watchdog.rb && bundle exec rails server thin -p $PORT
resque: bin/watchdog.rb && bundle exec resque
@vovayartsev
vovayartsev / gist:acbe9ac5af89f8548824
Last active August 29, 2015 14:16
Identify log entries without comments
(function() {
function isBlankLog(log) { return !log.update_text }
$('.table-treport-cell-wrap').each(function(){
var time = $(this).scope().time;
var logs = time ? time.time_logs : [];
if (_.any(logs, isBlankLog)) {
$(this).css('color', 'red')
}
})
### Keybase proof
I hereby claim:
* I am vovayartsev on github.
* I am vovayartsev (https://keybase.io/vovayartsev) on keybase.
* I have a public key whose fingerprint is 3140 7588 BD79 5AE3 DB45 2215 E9DB 2AB3 C0AC 4A98
To claim this, I am signing this object:
@vovayartsev
vovayartsev / gist:b190ef7e8be94623307b
Created March 16, 2015 16:46
Successful user parameters
1. On Landing page:
"My Family and I", 2 adults, 2 dependent
2. On Basic Information:
ZIP 55001, annual income 90000, default household size (1)
Myself: male, 27 years old, tobacco use
Adult: female, 26 years old, can get insurance from an employer
Dependent: male, 3 years old
3. Medications:
Making check in src
make[1]: Entering directory `/app/tmpdir/gems/gpgme-2.0.8/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.5.3/gpgme-1.5.3/src'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/app/tmpdir/gems/gpgme-2.0.8/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.5.3/gpgme-1.5.3/src'
Making check in tests
make[1]: Entering directory `/app/tmpdir/gems/gpgme-2.0.8/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.5.3/gpgme-1.5.3/tests'
Making check in gpg
make[2]: Entering directory `/app/tmpdir/gems/gpgme-2.0.8/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.5.3/gpgme-1.5.3/tests/gpg'
make check-TESTS check-local
make[3]: Entering directory `/app/tmpdir/gems/gpgme-2.0.8/ext/gpgme/tmp/x86_64-linux-gnu/ports/gpgme/1.5.3/gpgme-1.5.3/tests/gpg'
pwd
ls -la
# DbAdapter provides access to the underlaying DB layer:
# DbAdapter.new.fetch_records(User, name: "Ivan", active: true) # => [ <#User>, <#User>, .... ]
#
class DbAdapter
def fetch_records(klass, conditions)
# .... returns an array of records
end
end
heroku dh:docker run jordi/ab ab -n 10000 -c 100 https://performance-test-app.herokuapp.com/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking performance-test-app.herokuapp.com (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests