Skip to content

Instantly share code, notes, and snippets.

@zorec
zorec / gist:5af961bd053076f1383d
Last active August 29, 2015 14:03
(My) common AngularJs tasks
### finish (yo) scaffolding by installing modules
sudo npm install
# this are usually missing
sudo npm install grunt grunt-karma karma-phantomjs-launcher karma-jasmine --save-dev
### Run protractor
webdriver-manager start
protractor ./protractor.conf.js
@zorec
zorec / action.rb
Created May 22, 2014 20:09
Ruby on Rails - measure frequency of actions (for optimalization or improving user interface)
# 3. wait few days (weeks) to gather data :)
# 4. display results by this rake task sorted from most frequent action to least frequent action
# rake action:show_frequency
# 5. The rule 80/20 says - users are doing 20% of actions in 80% of time
# -> increase performance, improve user experience, ... of these actions
namespace :action do
desc "This tasks shows freuquency of requests"
task show_frequency: :environment do
sum = Action.sum(:count)
Action.all.order('count desc').each_with_index do |a, index|