Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === TODO ================================
- --- webapp/server performance ---
- https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Facavalin.mooo.com&tab=mobile
- immagini:
- https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/image-optimization?hl=it
- https://www.google.it/search?q=website+test+google&oq=website+test+google&aqs=chrome..69i57.7730j0j4&sourceid=chrome-mobile&ie=UTF-8
- -- layout --
- http://materializecss.com/
- http://learn.shayhowe.com/advanced-html-css/responsive-web-design/
- fonts: https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization?hl=it
- --- js charts ---
- https://google-developers.appspot.com/chart/interactive/docs/
- D3js
- altro...?
- --- certificati ssl gratis? ---
- https://letsencrypt.org/
- --- chrome push notifications example ---
- https://storage-cdn.realtime.co/chrome-push/index.html
- http://stackoverflow.com/questions/2271156/chrome-desktop-notification-example
- --- process monitoring ---
- https://mmonit.com
- === DONE ================================
- --- modelli nested ---
- https://coderwall.com/p/2tnpfa/easily-namespace-your-rails-models
- http://stackoverflow.com/questions/17446716/rails-how-to-properly-move-models-to-a-namespace
- http://stackoverflow.com/questions/5852626/handling-namespace-models-classes-in-namespace
- http://blog.makandra.com/2014/12/organizing-large-rails-projects-with-namespaces/
- --- multi db ---
- sqlite3 attach command:
- # /config/environment.rb -- attach di un database separato
- # ActiveRecord::Base.connection.execute %Q|ATTACH DATABASE '#{Rails.root}/db/#{Rails.env}_nome.sqlite3' AS nome|
- 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
- http://stackoverflow.com/questions/17311199/connecting-to-multiple-databases-in-ruby-on-rails
- http://technology.customink.com/blog/2015/06/22/rails-multi-database-best-practices-roundup/
- --- gestione utenti ---
- https://github.com/plataformatec/devise
- --- time parsing ---
- https://github.com/mojombo/chronic
- Chronic.parse('10th day of next month')
- --- mail ---
- http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
- http://api.rubyonrails.org/classes/ActionMailer/Base.html
- --- crontab ---
- http://www.gotealeaf.com/blog/cron-jobs-and-rails
- https://github.com/javan/whenever
- http://stackoverflow.com/questions/1070231/rails-cron-with-whenever-setting-the-environment
- * runner "...", output: "#{path}/log/out.log"/nil
- * whenever -i # installa/aggiorna cronjobs
- --- deploy (nginx + thin cluster) ---
- http://nginx.org/en/docs/
- http://code.macournoyer.com/thin/usage/
- https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration
- examples:
- https://www.nginx.com/resources/wiki/start/topics/examples/full/
- http://unicorn.bogomips.org/examples/nginx.conf (commented)
- altro:
- http://blog.mohitkanwal.com/blog/2013/04/10/deploying-rails-on-nginx-and-thin/
- http://kvz.io/blog/2010/09/21/ruby-with-nginx-on-ubuntu-lucid/
- http://www.perfectline.co/blog/2011/02/optimizing-ruby-on-rails-application-with-nodejs/
- --- gzip ---
- 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
- https://richonrails.com/articles/enabling-compression-for-nginx
- https://gist.github.com/kucaahbe/3017055
- http://serverfault.com/questions/571733/nginx-gzip-static-why-are-the-non-compressed-files-required
- --- nsginx rails assets ---
- http://dennisreimann.de/blog/configuring-nginx-for-the-asset-pipeline/
- http://guides.rubyonrails.org/asset_pipeline.html#in-production
- jqui: https://bibwild.wordpress.com/2011/12/08/jquery-ui-css-and-images-and-rails-asset-pipeline/
- https://mattbrictson.com/gzipped-assets-nginx-rails-42
- --- css spinner ---
- http://tobiasahlin.com/spinkit/
- --- blocking resources async load ---
- http://www.giftofspeed.com/defer-loading-css/ (Google's PageSpeed)
- https://github.com/filamentgroup/loadCSS
- https://github.com/filamentgroup/loadJS
- http://www.w3schools.com/tags/tag_script.asp (defer)
- --- nginx ssl setup ---
- sudo openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout ac.key -out ac.crt
- http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server
- http://stackoverflow.com/questions/25116103/how-do-i-setup-ssl-on-a-rails-4-app-nginx-passenger
- --- nginx catch-all domain ---
- http://stackoverflow.com/questions/9824328/why-is-nginx-responding-to-any-domain-name
- --- rails ssl ---
- https://github.com/plataformatec/devise/wiki/How-To:-Use-SSL-(HTTPS)
- http://www.eq8.eu/blogs/14-config-force_ssl-is-different-than-controller-force_ssl
- http://stackoverflow.com/questions/9527158/how-should-i-go-about-making-all-devise-paths-use-https
- https://github.com/mobalean/devise_ssl_session_verifiable
- http://guides.rubyonrails.org/security.html
- http://api.rubyonrails.org/classes/ActionController/ForceSSL/ClassMethods.html
- --- app security ---
- http://learn.onemonth.com/defensive-hacking-how-to-prevent-a-brute-force-attack
- => Devise lockable, recapcha?, rack attack, omniauth?
- http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable
- https://github.com/plataformatec/devise/wiki/How-To:-Use-Recaptcha-with-Devise
- https://github.com/kickstarter/rack-attack # throttling app requests
- --- i18n ---
- * traduci devise e activerecord errors/tables/fields:
- http://guides.rubyonrails.org/i18n.html
- http://guides.rubyonrails.org/i18n.html#organization-of-locale-files
- http://guides.rubyonrails.org/i18n.html#translations-for-active-record-models
- * traduzioni:
- https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml
- https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/it.yml
- https://github.com/tigrish/devise-i18n/blob/master/rails/locales/it.yml
- * locale in path:
- https://github.com/svenfuchs/routing-filter/
- # config/routes.rb
- filters :locale # prima di tutto
- # app/controllers/application_controller.rb
- def default_url_options(options = {})
- { locale: I18n.locale }.merge options
- end
- before_action :set_locale
- def set_locale
- I18n.locale = I18n.available_locales.map(&:to_s).include?(params[:locale]) ? \
- params[:locale].to_sym : I18n.default_locale
- end # set_locale -------------------------------------------------------------
- # config/initializers/routing_filter.rb
- RoutingFilter::Locale.include_default_locale = false
- --- js/ccs parallel dl + defer/ordered execution ---
- https://code.google.com/p/chromium/issues/detail?id=312327
- Http header: Link: <jquery.js>; rel=prefetch
- # wrap sprockets "require"
- http://stackoverflow.com/questions/10292631/wrap-a-few-asset-requires-in-a-javascript-closure
- # modern browser async-download and ordered-execution (...l'ordine non viene rispettato!)
- http://www.html5rocks.com/en/tutorials/speed/script-loading/
- ==> tutto nell'head:
- <link rel="subresource" href="//other-domain.com/1.js">
- <link rel="subresource" href="2.js">
- <script>
- [ '//other-domain.com/1.js', '2.js'].forEach(function(src) {
- var script = document.createElement('script');
- script.src = src; script.async = false; document.head.appendChild(script);
- });</script>
- # altre alternative:
- http://www.javascriptoo.com/defer-js/readme # vedi tabella confronti
- https://github.com/wessman/defer.js
- https://github.com/headjs/headjs
- https://github.com/ded/script.js -- http://www.dustindiaz.com/scriptjs/
- http://github.com/getify/LABjs -- http://labjs.com/
- # vanilla js xhr+eval:
- http://stackoverflow.com/questions/10834511/load-javascript-sequentially-from-javascript-code -- http://stackoverflow.com/a/10835093
- # async + blob/data-uri
- https://developer.mozilla.org/en-US/docs/Games/Techniques/Async_scripts
- --- nginx limits/restrictions --------------------------------------------------
- https://www.nginx.com/resources/admin-guide/restricting-access/
- --- manifest + favicon ---------------------------------------------------------
- https://developer.chrome.com/multidevice/android/installtohomescreen
- http://realfavicongenerator.net/
- http://mygimptutorial.com/web-20-button-with-reflection
- --- turbolinks -----------------------------------------------------------------
- http://brandonhilkert.com/blog/organizing-javascript-in-rails-application-with-turbolinks/
- --- android appcache ---
- - solo su /index + rake x creare il manifest con gli assets
- http://alistapart.com/article/application-cache-is-a-douchebag
- http://docs.webplatform.org/wiki/apis/appcache/ApplicationCache
- http://stackoverflow.com/questions/25496027/how-to-create-a-rails-4-offline-webapp
- - evento updateready => ricarica app
- http://www.html5rocks.com/en/tutorials/appcache/beginner/
- http://blog.christian-heindel.de/2011/10/25/debugging-html5-offline-web-applications/
- - manifest.appcache solo per i file correnti: vedi sprockets generated json manifest
- NB: su firefox premi shift+f2 => appcache commands; su chrome vedi appcache internals
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement