Tuesday, December 31, 2013
Monday, December 30, 2013
git: deleting a remote branch
http://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-remotely
git push origin --delete
branchName
Wednesday, December 25, 2013
Tuesday, December 24, 2013
Ruby: split vs regex, Benchmark
http://stackoverflow.com/questions/7533479/ruby-string-search-which-is-faster-split-or-regex
require 'benchmark'
Benchmark.bm do |x|
x.report { 50000.times { a = 'a@b.c'.split('@')[0] } }
x.report { 50000.times { a = 'a@b.c'[/[^@]+/] } }
end
Sunday, December 22, 2013
Rails: routes
If we want to 'namespace' our routes, but do not want the 'named routes' to have namespace's name in the prefix:
namespace :admin, as: '' do
get '/post/new' => 'posts#new', as: 'new_admin_post'
end
Thursday, December 19, 2013
Unobtrusive Javascript
Need to read these:
http://www.codeproject.com/Articles/410948/How-jQuery-and-unobtrusive-JavaScript-can-be-poiso
http://blog.socialcast.com/unobtrusive-javascript-2/
http://www.ibm.com/developerworks/library/wa-aj-unobtrusive/
http://www.w3.org/wiki/The_principles_of_unobtrusive_JavaScript
http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
http://stackoverflow.com/questions/8392374/difference-between-obtrusive-and-unobtrusive-javascript
http://stackoverflow.com/questions/4478795/what-is-unobtrusive-javascript-in-layman-terms
http://www.codeproject.com/Articles/410948/How-jQuery-and-unobtrusive-JavaScript-can-be-poiso
http://blog.socialcast.com/unobtrusive-javascript-2/
http://www.ibm.com/developerworks/library/wa-aj-unobtrusive/
http://www.w3.org/wiki/The_principles_of_unobtrusive_JavaScript
http://en.wikipedia.org/wiki/Unobtrusive_JavaScript
http://stackoverflow.com/questions/8392374/difference-between-obtrusive-and-unobtrusive-javascript
http://stackoverflow.com/questions/4478795/what-is-unobtrusive-javascript-in-layman-terms
Monday, December 9, 2013
Wednesday, December 4, 2013
Analytics: Piwik, Clicky
Piwik:
------
Piwik does not have Event Tracking
http://piwik.org/docs/analytics-api/reference/#SitesManager
http://piwik.org/docs/analytics-api/calling-techniques/
http://dev.piwik.org/trac
http://www.youtube.com/user/PiwikAnalytics
http://www.statstory.com/some-reasons-to-choose-piwik-analytics-over-google-analytics/
http://stackoverflow.com/questions/9662357/google-analytics-and-piwik-discrepancy
Clicky:
--------
http://clicky.com/compare/piwik
------
Piwik does not have Event Tracking
http://piwik.org/docs/analytics-api/reference/#SitesManager
http://piwik.org/docs/analytics-api/calling-techniques/
http://dev.piwik.org/trac
http://www.youtube.com/user/PiwikAnalytics
http://www.statstory.com/some-reasons-to-choose-piwik-analytics-over-google-analytics/
http://stackoverflow.com/questions/9662357/google-analytics-and-piwik-discrepancy
Clicky:
--------
http://clicky.com/compare/piwik
Monday, December 2, 2013
Rails: Reordering Columns
Sometimes it is necessary to reorder columns so that data is presented, by default, in a more meaningful way e.g. the 'key' columns probably should appear in the beginning, followed by other columns that do not allow a Null value, followed by columns that can take in Null values (basically, are not that important)
http://stackoverflow.com/questions/18899011/rails-4-migration-how-to-reorder-columns
http://stackoverflow.com/questions/18899011/rails-4-migration-how-to-reorder-columns
Sunday, December 1, 2013
Rails: scope in models
scope :my_books, lambda {|user_id| {:conditions => ["user_id = ?", user_id] }}
Have to read about scope and conditions - how to specify And , Or ?
Have to read about scope and conditions - how to specify And , Or ?
Subscribe to:
Posts (Atom)