acavalin

RoR resources

Oct 8th, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.04 KB | None | 0 0
  1. === TODO ================================
  2. --- webapp/server performance ---
  3. https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Facavalin.mooo.com&tab=mobile
  4.  
  5. immagini:
  6. https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization?hl=it
  7.  
  8. https://www.google.it/search?q=website+test+google&oq=website+test+google&aqs=chrome..69i57.7730j0j4&sourceid=chrome-mobile&ie=UTF-8
  9.  
  10. -- layout --
  11. http://materializecss.com/
  12. http://learn.shayhowe.com/advanced-html-css/responsive-web-design/
  13. fonts: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization?hl=it
  14.  
  15. --- js charts ---
  16. https://google-developers.appspot.com/chart/interactive/docs/
  17. D3js
  18. altro...?
  19.  
  20. --- certificati ssl gratis? ---
  21. https://letsencrypt.org/
  22.  
  23. --- chrome push notifications example ---
  24. https://storage-cdn.realtime.co/chrome-push/index.html
  25. http://stackoverflow.com/questions/2271156/chrome-desktop-notification-example
  26.  
  27. --- process monitoring ---
  28. https://mmonit.com
  29.  
  30. === DONE ================================
  31. --- modelli nested ---
  32. https://coderwall.com/p/2tnpfa/easily-namespace-your-rails-models
  33. http://stackoverflow.com/questions/17446716/rails-how-to-properly-move-models-to-a-namespace
  34. http://stackoverflow.com/questions/5852626/handling-namespace-models-classes-in-namespace
  35. http://blog.makandra.com/2014/12/organizing-large-rails-projects-with-namespaces/
  36.  
  37. --- multi db ---
  38. sqlite3 attach command:
  39. # /config/environment.rb -- attach di un database separato
  40. # ActiveRecord::Base.connection.execute %Q|ATTACH DATABASE '#{Rails.root}/db/#{Rails.env}_nome.sqlite3' AS nome|
  41.  
  42. https://www.google.it/search?q=rails+4+multiple+databases&oq=rails+4+mult&aqs=chrome.1.69i57j0l3.7740j0j4&client=tablet-android-lenovo&sourceid=chrome-mobile&espv=1&ie=UTF-8
  43. http://stackoverflow.com/questions/17311199/connecting-to-multiple-databases-in-ruby-on-rails
  44. http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/
  45.  
  46. --- gestione utenti ---
  47. https://github.com/plataformatec/devise
  48.  
  49. --- time parsing ---
  50. https://github.com/mojombo/chronic
  51. Chronic.parse('10th day of next month')
  52.  
  53. --- mail ---
  54. http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
  55. http://api.rubyonrails.org/classes/ActionMailer/Base.html
  56.  
  57. --- crontab ---
  58. http://www.gotealeaf.com/blog/cron-jobs-and-rails
  59. https://github.com/javan/whenever
  60. http://stackoverflow.com/questions/1070231/rails-cron-with-whenever-setting-the-environment
  61.  
  62. * runner "...", output: "#{path}/log/out.log"/nil
  63. * whenever -i # installa/aggiorna cronjobs
  64.  
  65. --- deploy (nginx + thin cluster) ---
  66. http://nginx.org/en/docs/
  67. http://code.macournoyer.com/thin/usage/
  68.  
  69. https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
  70.  
  71. examples:
  72. https://www.nginx.com/resources/wiki/start/topics/examples/full/
  73. http://unicorn.bogomips.org/examples/nginx.conf (commented)
  74.  
  75. altro:
  76. http://blog.mohitkanwal.com/blog/2013/04/10/deploying-rails-on-nginx-and-thin/
  77. http://kvz.io/blog/2010/09/21/ruby-with-nginx-on-ubuntu-lucid/
  78.  
  79. http://www.perfectline.co/blog/2011/02/optimizing-ruby-on-rails-application-with-nodejs/
  80.  
  81. --- gzip ---
  82. https://www.google.it/search?q=rails+gzip&oq=rails+gzip&aqs=chrome..69i57j0l3.8227j1j4&sourceid=chrome-mobile&ie=UTF-8#q=rails+nginx+gzip
  83.  
  84. https://richonrails.com/articles/enabling-compression-for-nginx
  85.  
  86. https://gist.github.com/kucaahbe/3017055
  87.  
  88. http://serverfault.com/questions/571733/nginx-gzip-static-why-are-the-non-compressed-files-required
  89.  
  90. --- nsginx rails assets ---
  91. http://dennisreimann.de/blog/configuring-nginx-for-the-asset-pipeline/
  92. http://guides.rubyonrails.org/asset_pipeline.html#in-production
  93.  
  94. jqui: https://bibwild.wordpress.com/2011/12/08/jquery-ui-css-and-images-and-rails-asset-pipeline/
  95.  
  96. https://mattbrictson.com/gzipped-assets-nginx-rails-42
  97.  
  98. --- css spinner ---
  99. http://tobiasahlin.com/spinkit/
  100.  
  101. --- blocking resources async load ---
  102. http://www.giftofspeed.com/defer-loading-css/ (Google's PageSpeed)
  103. https://github.com/filamentgroup/loadCSS
  104. https://github.com/filamentgroup/loadJS
  105. http://www.w3schools.com/tags/tag_script.asp (defer)
  106.  
  107. --- nginx ssl setup ---
  108. sudo openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout ac.key -out ac.crt
  109.  
  110. http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
  111.  
  112. http://stackoverflow.com/questions/25116103/how-do-i-setup-ssl-on-a-rails-4-app-nginx-passenger
  113.  
  114. --- nginx catch-all domain ---
  115. http://stackoverflow.com/questions/9824328/why-is-nginx-responding-to-any-domain-name
  116.  
  117. --- rails ssl ---
  118. https://github.com/plataformatec/devise/wiki/How-To:-Use-SSL-(HTTPS)
  119.  
  120. http://www.eq8.eu/blogs/14-config-force_ssl-is-different-than-controller-force_ssl
  121.  
  122. http://stackoverflow.com/questions/9527158/how-should-i-go-about-making-all-devise-paths-use-https
  123. https://github.com/mobalean/devise_ssl_session_verifiable
  124.  
  125. http://guides.rubyonrails.org/security.html
  126. http://api.rubyonrails.org/classes/ActionController/ForceSSL/ClassMethods.html
  127.  
  128. --- app security ---
  129. http://learn.onemonth.com/defensive-hacking-how-to-prevent-a-brute-force-attack
  130.  
  131. => Devise lockable, recapcha?, rack attack, omniauth?
  132. http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable
  133.  
  134. https://github.com/plataformatec/devise/wiki/How-To:-Use-Recaptcha-with-Devise
  135.  
  136. https://github.com/kickstarter/rack-attack # throttling app requests
  137.  
  138. --- i18n ---
  139. * traduci devise e activerecord errors/tables/fields:
  140. http://guides.rubyonrails.org/i18n.html
  141. http://guides.rubyonrails.org/i18n.html#organization-of-locale-files
  142. http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
  143.  
  144. * traduzioni:
  145. https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
  146. https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/it.yml
  147. https://github.com/tigrish/devise-i18n/blob/master/rails/locales/it.yml
  148.  
  149. * locale in path:
  150. https://github.com/svenfuchs/routing-filter/
  151.  
  152. # config/routes.rb
  153. filters :locale # prima di tutto
  154.  
  155. # app/controllers/application_controller.rb
  156. def default_url_options(options = {})
  157. { locale: I18n.locale }.merge options
  158. end
  159.  
  160. before_action :set_locale
  161. def set_locale
  162. I18n.locale = I18n.available_locales.map(&:to_s).include?(params[:locale]) ? \
  163. params[:locale].to_sym : I18n.default_locale
  164. end # set_locale -------------------------------------------------------------
  165.  
  166. # config/initializers/routing_filter.rb
  167. RoutingFilter::Locale.include_default_locale = false
  168.  
  169. --- js/ccs parallel dl + defer/ordered execution ---
  170. https://code.google.com/p/chromium/issues/detail?id=312327
  171.  
  172. Http header: Link: <jquery.js>; rel=prefetch
  173.  
  174. # wrap sprockets "require"
  175. http://stackoverflow.com/questions/10292631/wrap-a-few-asset-requires-in-a-javascript-closure
  176.  
  177. # modern browser async-download and ordered-execution (...l'ordine non viene rispettato!)
  178. http://www.html5rocks.com/en/tutorials/speed/script-loading/
  179. ==> tutto nell'head:
  180. <link rel="subresource" href="//other-domain.com/1.js">
  181. <link rel="subresource" href="2.js">
  182. <script>
  183. [ '//other-domain.com/1.js', '2.js'].forEach(function(src) {
  184. var script = document.createElement('script');
  185. script.src = src; script.async = false; document.head.appendChild(script);
  186. });</script>
  187.  
  188. # altre alternative:
  189. http://www.javascriptoo.com/defer-js/readme # vedi tabella confronti
  190. https://github.com/wessman/defer.js
  191. https://github.com/headjs/headjs
  192. https://github.com/ded/script.js -- http://www.dustindiaz.com/scriptjs/
  193. http://github.com/getify/LABjs -- http://labjs.com/
  194.  
  195. # vanilla js xhr+eval:
  196. http://stackoverflow.com/questions/10834511/load-javascript-sequentially-from-javascript-code -- http://stackoverflow.com/a/10835093
  197.  
  198. # async + blob/data-uri
  199. https://developer.mozilla.org/en-US/docs/Games/Techniques/Async_scripts
  200.  
  201. --- nginx limits/restrictions --------------------------------------------------
  202. https://www.nginx.com/resources/admin-guide/restricting-access/
  203.  
  204. --- manifest + favicon ---------------------------------------------------------
  205. https://developer.chrome.com/multidevice/android/installtohomescreen
  206. http://realfavicongenerator.net/
  207. http://mygimptutorial.com/web-20-button-with-reflection
  208.  
  209. --- turbolinks -----------------------------------------------------------------
  210. http://brandonhilkert.com/blog/organizing-javascript-in-rails-application-with-turbolinks/
  211.  
  212. --- android appcache ---
  213. - solo su /index + rake x creare il manifest con gli assets
  214. http://alistapart.com/article/application-cache-is-a-douchebag
  215. http://docs.webplatform.org/wiki/apis/appcache/ApplicationCache
  216. http://stackoverflow.com/questions/25496027/how-to-create-a-rails-4-offline-webapp
  217.  
  218. - evento updateready => ricarica app
  219. http://www.html5rocks.com/en/tutorials/appcache/beginner/
  220. http://blog.christian-heindel.de/2011/10/25/debugging-html5-offline-web-applications/
  221.  
  222. - manifest.appcache solo per i file correnti: vedi sprockets generated json manifest
  223.  
  224. NB: su firefox premi shift+f2 => appcache commands; su chrome vedi appcache internals
Advertisement
Add Comment
Please, Sign In to add comment