production-environment

Angular 2: Reduce app size (in addition to bundling/minification)

天涯浪子 提交于 2019-11-28 10:07:16
I have a small-medium size (~28 KB including just the (TypeScript transpiled) JS + HTML templates) Angular 2 app. It's based originally on the angular.io quickstart , but now I am bundling/minifying it using JSPM for deployment. The bundled JS file I get is 2.1 MB, coming down to 449 KB when served with gzip compression. This is still rather large, and I would like to ask how best to go about reducing the overall size of the app for deployment, to deliver my app in the smallest and most efficient bundle. Edit : I should mention that I've reduced the uncompressed but minified bundle size to 1.9

Rails Internationalization (I18n) in model validations: Possible or not?

心不动则不痛 提交于 2019-11-28 08:01:30
I have the following validation in a model: validates_inclusion_of :whatever, :in => [true, false], :message => I18n.t('please_select_whatever') It seems that the translation does not work in production mode: in all languages it's always the english translation that gets diplayed (probably because I set english as the default locale in my app...?). So I am assuming that we can't translate validations in models, because models get loaded only once - when the server is booted (and then, the default locale would be applied). Am I right? If yes, how would you solve this problem? Thanks for your

iPhone: Push Notification Testing on Production Certificate

爷,独闯天下 提交于 2019-11-28 07:19:09
I have a quick question. I have been testing Development Push Notification Certificate for my iPhone App and its been working fine. I just want to know that is it possible to test Production Certificate before submitting my application to AppStore? I did try but message is not coming along when I use production certificate. Does Apple required application to be in AppStore when I use production certificate? Thanks. If you create an Ad-Hoc Profile, you'll find that it uses the production certificate, that's possibly the easiest way of testing it out. UPDATE: See the Apple documentation here

SQLite as a production database for a low-traffic site?

北慕城南 提交于 2019-11-28 04:28:49
I'm considering using SQLite as a production database for a site that would receive perhaps 20 simultaneous users, but with the potential for a peak that could be many multiples of that (since the site would be accessible on the open internet and there's always a possibility that someone will post a link somewhere that could drive many people to the site all at once). Is SQLite a possibility? I know it's not an ideal production scenario. I'm only asking if this is within the realm of being a realistic possibility. Bayard Randel SQLite doesn't support any kind of concurrency, so you may have

Performance impact of using css / javascript source-maps in production?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 03:45:43
Should source-maps be used in production environment? Do they provide any benefits other than debugging? Do they impact app load time due to the additional server round-trips? Are browsers smart enough to load .map assets after app is loaded and rendered? If a browser cannot find the .map asset ( 404 error), would there be performance impact? Should I care about fixing it? Note that fixing the last one may not be as easy as serving the .map assets if there are complicated concat / minify build steps. A quick test using Charles Web Proxy shows that source maps are only loaded if developer tools

Node.js, express, and using development versus production in app.configure

本小妞迷上赌 提交于 2019-11-28 03:29:02
What is the easiest method to let express know what environment I am in? E.g. I want do do the below to make a connection to redis depending on what env I am in. Can this be done from the command line? app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); var r = require("redis").createClient(6379,'127.0.0.1'); }); app.configure('production', function(){ app.use(express.errorHandler()); r = redis.createClient(6379,'46.137.195.230', { detect_buffers: true }); }); Your approach is ok, but you can make something more generic, like

Webrick as production server vs. Thin or Unicorn?

丶灬走出姿态 提交于 2019-11-28 03:01:11
It seems like it's taken for granted that you must not use Webrick as production server, but I can't really find anywhere mentioning why. The consensus seems to be: "Webrick is ok for development, but Thin or Unicorn is the choice for production, period." I did look up Thin server's homepage and it talks about requests/second but I don't really understand the graph since there's no annotation. Can anyone let me know why I should use Thin or Unicorn compared to Webrick? Also is there any benefit to using Webrick for development? I've been using Webrick since it comes with rails, and I think

How to set up tmux so that it starts up with specified windows opened?

落爺英雄遲暮 提交于 2019-11-28 02:31:00
How to set up tmux so that it starts up with specified windows opened? Amjith You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment: #!/bin/sh tmux new-session -d 'vim' tmux split-window -v 'ipython' tmux split-window -h tmux new-window 'mutt' tmux -2 attach-session -d So everytime I want to launch my favorite dev environment I can just do $ dev-tmux Waqar Lim I was trying to create a complex grid of panes and had to deal with switching and splitting panes over and over again. Here are my

problem implementing wicked pdf on heroku

泄露秘密 提交于 2019-11-27 17:54:05
I am using this guide for integrating wicked_pdf on heroku. But somehow it doesn't seem to work. I got the logs from heroku and its says this: Processing PdfController#get_pdf to pdf (for 115.248.175.50 at 2011-02-15 23:54:44) [GET] Parameters: {"format"=>"pdf", "action"=>"get_pdf", "id"=>"1", "controller"=>"pdf"} ***************WICKED*************** Rendering pdf/get_pdf RuntimeError (PDF could not be generated! /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `exec': No such file or directory - /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/bin/wkhtmltopdf-amd64 - - (Errno::ENOENT) from /usr/ruby1

Moving app to production mode in Symfony 2

最后都变了- 提交于 2019-11-27 17:06:56
Can someone help me to move my Symfony 2 application into production mode? Currently, the application is running properly in /app_dev.php . I'm googling, but I'm not finding a definite guide for deployment in Symfony 2. Couple more things to consider: php app/console cache:clear --env=prod --no-debug php app/console assets:install web_directory php app/console assetic:dump web_directory You might also run into permission issues with the cache directory. I would actually first make sure everything works in development mode on the server before switching to production mode. And if all you get is