hullapp 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/.DS_Store +0 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +66 -0
  6. data/Rakefile +1 -0
  7. data/bin/hull +15 -0
  8. data/hullapp.gemspec +27 -0
  9. data/lib/hull.rb +6 -0
  10. data/lib/hull/cli.rb +124 -0
  11. data/lib/hull/version.rb +3 -0
  12. data/templates/.DS_Store +0 -0
  13. data/templates/hullenv.tt +4 -0
  14. data/templates/ruby/.gitignore +7 -0
  15. data/templates/ruby/.powenv +8 -0
  16. data/templates/ruby/.powrc +5 -0
  17. data/templates/ruby/.rvmrc.tt +1 -0
  18. data/templates/ruby/Gemfile +50 -0
  19. data/templates/ruby/Guardfile +8 -0
  20. data/templates/ruby/Procfile +4 -0
  21. data/templates/ruby/README.md +198 -0
  22. data/templates/ruby/Rakefile +40 -0
  23. data/templates/ruby/application/assets.rb +7 -0
  24. data/templates/ruby/application/assets/images/icons/facebook.png +0 -0
  25. data/templates/ruby/application/assets/images/icons/twitter.png +0 -0
  26. data/templates/ruby/application/assets/images/socialmedia/app-store.png +0 -0
  27. data/templates/ruby/application/assets/images/socialmedia/dribbble.png +0 -0
  28. data/templates/ruby/application/assets/images/socialmedia/facebook.png +0 -0
  29. data/templates/ruby/application/assets/images/socialmedia/flickr.png +0 -0
  30. data/templates/ruby/application/assets/images/socialmedia/forrst.png +0 -0
  31. data/templates/ruby/application/assets/images/socialmedia/foursquare.png +0 -0
  32. data/templates/ruby/application/assets/images/socialmedia/github.png +0 -0
  33. data/templates/ruby/application/assets/images/socialmedia/google-plus.png +0 -0
  34. data/templates/ruby/application/assets/images/socialmedia/google.png +0 -0
  35. data/templates/ruby/application/assets/images/socialmedia/instagram.png +0 -0
  36. data/templates/ruby/application/assets/images/socialmedia/linkedin.png +0 -0
  37. data/templates/ruby/application/assets/images/socialmedia/skype.png +0 -0
  38. data/templates/ruby/application/assets/images/socialmedia/social-email.png +0 -0
  39. data/templates/ruby/application/assets/images/socialmedia/social-rss.png +0 -0
  40. data/templates/ruby/application/assets/images/socialmedia/spotify.png +0 -0
  41. data/templates/ruby/application/assets/images/socialmedia/tumblr.png +0 -0
  42. data/templates/ruby/application/assets/images/socialmedia/twitter-2.png +0 -0
  43. data/templates/ruby/application/assets/images/socialmedia/twitter.png +0 -0
  44. data/templates/ruby/application/assets/images/socialmedia/vimeo.png +0 -0
  45. data/templates/ruby/application/assets/images/socialmedia/youtube.png +0 -0
  46. data/templates/ruby/application/assets/javascripts/app.js +11 -0
  47. data/templates/ruby/application/assets/javascripts/main.coffee +17 -0
  48. data/templates/ruby/application/assets/javascripts/template.js.erb +1 -0
  49. data/templates/ruby/application/assets/stylesheets/partials/_base.scss +17 -0
  50. data/templates/ruby/application/assets/stylesheets/partials/_boilerplate.scss +291 -0
  51. data/templates/ruby/application/assets/stylesheets/partials/_colors.scss +0 -0
  52. data/templates/ruby/application/assets/stylesheets/partials/_fonts.scss +1 -0
  53. data/templates/ruby/application/assets/stylesheets/partials/_h5bp.scss +298 -0
  54. data/templates/ruby/application/assets/stylesheets/partials/_layout.scss +12 -0
  55. data/templates/ruby/application/assets/stylesheets/partials/_normalize.scss +504 -0
  56. data/templates/ruby/application/assets/stylesheets/partials/_variables.scss +28 -0
  57. data/templates/ruby/application/assets/stylesheets/style.scss +16 -0
  58. data/templates/ruby/application/assets/templates/hello.hbs +1 -0
  59. data/templates/ruby/application/compass.rb +27 -0
  60. data/templates/ruby/application/core.rb +15 -0
  61. data/templates/ruby/application/core_extensions/blank.rb +111 -0
  62. data/templates/ruby/application/core_extensions/hash.rb +34 -0
  63. data/templates/ruby/application/core_extensions/sprockets.rb +74 -0
  64. data/templates/ruby/application/core_extensions/try.rb +57 -0
  65. data/templates/ruby/application/helpers.rb +121 -0
  66. data/templates/ruby/application/helpers/form_tag_helpers.rb +127 -0
  67. data/templates/ruby/application/helpers/notification_helpers.rb +20 -0
  68. data/templates/ruby/application/helpers/run_later.rb +111 -0
  69. data/templates/ruby/application/settings.rb +8 -0
  70. data/templates/ruby/application/views/demo.erb +27 -0
  71. data/templates/ruby/application/views/index.erb +9 -0
  72. data/templates/ruby/application/views/layout.erb +45 -0
  73. data/templates/ruby/application/workers.rb +0 -0
  74. data/templates/ruby/config.ru +84 -0
  75. data/templates/ruby/config/settings.yml +53 -0
  76. data/templates/ruby/config/sidekiq.yml +11 -0
  77. data/templates/ruby/config/unicorn.rb +91 -0
  78. data/templates/ruby/public/.htaccess +538 -0
  79. data/templates/ruby/public/404.html +157 -0
  80. data/templates/ruby/public/apple-touch-icon-114x114-precomposed.png +0 -0
  81. data/templates/ruby/public/apple-touch-icon-144x144-precomposed.png +0 -0
  82. data/templates/ruby/public/apple-touch-icon-57x57-precomposed.png +0 -0
  83. data/templates/ruby/public/apple-touch-icon-72x72-precomposed.png +0 -0
  84. data/templates/ruby/public/apple-touch-icon-precomposed.png +0 -0
  85. data/templates/ruby/public/apple-touch-icon.png +0 -0
  86. data/templates/ruby/public/crossdomain.xml +15 -0
  87. data/templates/ruby/public/favicon.ico +0 -0
  88. data/templates/ruby/public/humans.txt +15 -0
  89. data/templates/ruby/public/robots.txt +5 -0
  90. data/templates/ruby/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  91. data/templates/ruby/vendor/assets/images/glyphicons-halflings.png +0 -0
  92. data/templates/ruby/vendor/assets/javascripts/backbone.js +1431 -0
  93. data/templates/ruby/vendor/assets/javascripts/bootstrap.js +2027 -0
  94. data/templates/ruby/vendor/assets/javascripts/index.js +0 -0
  95. data/templates/ruby/vendor/assets/javascripts/jquery.js +9227 -0
  96. data/templates/ruby/vendor/assets/javascripts/modernizr.js +11 -0
  97. data/templates/ruby/vendor/assets/javascripts/underscore.js +1059 -0
  98. data/templates/ruby/vendor/assets/javascripts/vendor.js +2 -0
  99. data/templates/ruby/vendor/assets/stylesheets/bootstrap-responsive.css +1040 -0
  100. data/templates/ruby/vendor/assets/stylesheets/bootstrap.css +5624 -0
  101. data/templates/ruby/vendor/assets/stylesheets/vendor.scss +2 -0
  102. metadata +243 -0
@@ -0,0 +1,11 @@
1
+ ---
2
+ :concurrency: 50
3
+ :pidfile: ./tmp/worker.pid
4
+ :require: ./application/workers.rb
5
+ :queues:
6
+ - [savages, 4]
7
+ - [cleanup, 1]
8
+ - [covers, 2]
9
+ - [profiles,2]
10
+ - [notifs, 1]
11
+ - [default, 1]
@@ -0,0 +1,91 @@
1
+ # See http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb for a much simpler configuration file.
2
+ # See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete documentation.
3
+ # Or the base http://unicorn.bogomips.org/
4
+
5
+ # paths and things
6
+ wd = File.expand_path('../../', __FILE__)
7
+ development = !wd.include?('deploy') # change this to match your deploy, or use another method to determine
8
+ tmp_path = File.join(wd, 'tmp')
9
+ socket_path = File.join(tmp_path, 'unicorn.sock')
10
+ pid_path = File.join(tmp_path, 'unicorn.pid')
11
+ err_path = File.join(tmp_path, 'log/error.log')
12
+ out_path = File.join(tmp_path, 'log/out.log')
13
+
14
+ # Use at least one worker per core if you're on a dedicated server,
15
+ # more will usually help for _short_ waits on databases/caches.
16
+ worker_processes 2
17
+
18
+ # If running the master process as root and the workers as an unprivileged
19
+ # user, do this to switch euid/egid in the workers (also chowns logs):
20
+ # user "unprivileged_user", "unprivileged_group"
21
+
22
+ # tell it where to be
23
+ working_directory wd
24
+
25
+ # listen on both a Unix domain socket and a TCP port,
26
+ # we use a shorter backlog for quicker failover when busy
27
+ if development
28
+ listen 4567, :tcp_nopush => true
29
+ else
30
+ listen socket_path, :backlog => 64
31
+ end
32
+
33
+
34
+ # nuke workers after 30 seconds instead of 60 seconds (the default)
35
+ timeout 30
36
+
37
+ # feel free to point this anywhere accessible on the filesystem
38
+ pid pid_path
39
+
40
+ # By default, the Unicorn logger will write to stderr.
41
+ # Additionally, ome applications/frameworks log to stderr or stdout,
42
+ # so prevent them from going to /dev/null when daemonized here:
43
+ unless development
44
+ stderr_path err_path
45
+ stdout_path out_path
46
+ end
47
+
48
+ # combine Ruby 2.0.0dev or REE with "preload_app true" for memory savings
49
+ # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
50
+ preload_app false
51
+
52
+ GC.respond_to?(:copy_on_write_friendly=) and
53
+ GC.copy_on_write_friendly = true
54
+
55
+ before_fork do |server, worker|
56
+ # The following is only recommended for memory/DB-constrained
57
+ # installations. It is not needed if your system can house
58
+ # twice as many worker_processes as you have configured.
59
+ #
60
+ # # This allows a new master process to incrementally
61
+ # # phase out the old master process with SIGTTOU to avoid a
62
+ # # thundering herd (especially in the "preload_app false" case)
63
+ # # when doing a transparent upgrade. The last worker spawned
64
+ # # will then kill off the old master process with a SIGQUIT.
65
+ # old_pid = "#{server.config[:pid]}.oldbin"
66
+ # if old_pid != server.pid
67
+ # begin
68
+ # sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
69
+ # Process.kill(sig, File.read(old_pid).to_i)
70
+ # rescue Errno::ENOENT, Errno::ESRCH
71
+ # end
72
+ # end
73
+ #
74
+ # Throttle the master from forking too quickly by sleeping. Due
75
+ # to the implementation of standard Unix signal handlers, this
76
+ # helps (but does not completely) prevent identical, repeated signals
77
+ # from being lost when the receiving process is busy.
78
+ # sleep 1
79
+ end
80
+
81
+ after_fork do |server, worker|
82
+ # per-process listener ports for debugging/admin/migrations
83
+ # addr = "127.0.0.1:#{9293 + worker.nr}"
84
+ # server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
85
+
86
+ # if preload_app is true, then you may also want to check and
87
+ # restart any other shared sockets/descriptors such as Memcached,
88
+ # and Redis. TokyoCabinet file handles are safe to reuse
89
+ # between any number of forked children (assuming your kernel
90
+ # correctly implements pread()/pwrite() system calls)
91
+ end
@@ -0,0 +1,538 @@
1
+ # Apache configuration file
2
+ # httpd.apache.org/docs/2.2/mod/quickreference.html
3
+
4
+ # Note .htaccess files are an overhead, this logic should be in your Apache config if possible
5
+ # httpd.apache.org/docs/2.2/howto/htaccess.html
6
+
7
+ # Techniques in here adapted from all over, including:
8
+ # Kroc Camen: camendesign.com/.htaccess
9
+ # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
10
+ # Sample .htaccess file of CMS MODx: modxcms.com
11
+
12
+
13
+ ###
14
+ ### If you run a webserver other than Apache, consider:
15
+ ### github.com/h5bp/server-configs
16
+ ###
17
+
18
+
19
+
20
+ # ----------------------------------------------------------------------
21
+ # Better website experience for IE users
22
+ # ----------------------------------------------------------------------
23
+
24
+ # Force the latest IE version, in various cases when it may fall back to IE7 mode
25
+ # github.com/rails/rails/commit/123eb25#commitcomment-118920
26
+ # Use ChromeFrame if it's installed for a better experience for the poor IE folk
27
+
28
+ <IfModule mod_headers.c>
29
+ Header set X-UA-Compatible "IE=Edge,chrome=1"
30
+ # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
31
+ <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" >
32
+ Header unset X-UA-Compatible
33
+ </FilesMatch>
34
+ </IfModule>
35
+
36
+
37
+ # ----------------------------------------------------------------------
38
+ # Cross-domain AJAX requests
39
+ # ----------------------------------------------------------------------
40
+
41
+ # Serve cross-domain Ajax requests, disabled by default.
42
+ # enable-cors.org
43
+ # code.google.com/p/html5security/wiki/CrossOriginRequestSecurity
44
+
45
+ # <IfModule mod_headers.c>
46
+ # Header set Access-Control-Allow-Origin "*"
47
+ # </IfModule>
48
+
49
+
50
+ # ----------------------------------------------------------------------
51
+ # CORS-enabled images (@crossorigin)
52
+ # ----------------------------------------------------------------------
53
+
54
+ # Send CORS headers if browsers request them; enabled by default for images.
55
+ # developer.mozilla.org/en/CORS_Enabled_Image
56
+ # blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html
57
+ # hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/
58
+ # wiki.mozilla.org/Security/Reviews/crossoriginAttribute
59
+
60
+ <IfModule mod_setenvif.c>
61
+ <IfModule mod_headers.c>
62
+ # mod_headers, y u no match by Content-Type?!
63
+ <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
64
+ SetEnvIf Origin ":" IS_CORS
65
+ Header set Access-Control-Allow-Origin "*" env=IS_CORS
66
+ </FilesMatch>
67
+ </IfModule>
68
+ </IfModule>
69
+
70
+
71
+ # ----------------------------------------------------------------------
72
+ # Webfont access
73
+ # ----------------------------------------------------------------------
74
+
75
+ # Allow access from all domains for webfonts.
76
+ # Alternatively you could only whitelist your
77
+ # subdomains like "subdomain.example.com".
78
+
79
+ <IfModule mod_headers.c>
80
+ <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
81
+ Header set Access-Control-Allow-Origin "*"
82
+ </FilesMatch>
83
+ </IfModule>
84
+
85
+
86
+
87
+ # ----------------------------------------------------------------------
88
+ # Proper MIME type for all files
89
+ # ----------------------------------------------------------------------
90
+
91
+
92
+ # JavaScript
93
+ # Normalize to standard type (it's sniffed in IE anyways)
94
+ # tools.ietf.org/html/rfc4329#section-7.2
95
+ AddType application/javascript js
96
+
97
+ # Audio
98
+ AddType audio/ogg oga ogg
99
+ AddType audio/mp4 m4a
100
+
101
+ # Video
102
+ AddType video/ogg ogv
103
+ AddType video/mp4 mp4 m4v
104
+ AddType video/webm webm
105
+
106
+ # SVG
107
+ # Required for svg webfonts on iPad
108
+ # twitter.com/FontSquirrel/status/14855840545
109
+ AddType image/svg+xml svg svgz
110
+ AddEncoding gzip svgz
111
+
112
+ # Webfonts
113
+ AddType application/vnd.ms-fontobject eot
114
+ AddType application/x-font-ttf ttf ttc
115
+ AddType font/opentype otf
116
+ AddType application/x-font-woff woff
117
+
118
+ # Assorted types
119
+ AddType image/x-icon ico
120
+ AddType image/webp webp
121
+ AddType text/cache-manifest appcache manifest
122
+ AddType text/x-component htc
123
+ AddType application/x-chrome-extension crx
124
+ AddType application/x-opera-extension oex
125
+ AddType application/x-xpinstall xpi
126
+ AddType application/octet-stream safariextz
127
+ AddType application/x-web-app-manifest+json webapp
128
+ AddType text/x-vcard vcf
129
+
130
+
131
+
132
+ # ----------------------------------------------------------------------
133
+ # Allow concatenation from within specific js and css files
134
+ # ----------------------------------------------------------------------
135
+
136
+ # e.g. Inside of script.combined.js you could have
137
+ # <!--#include file="libs/jquery-1.5.0.min.js" -->
138
+ # <!--#include file="plugins/jquery.idletimer.js" -->
139
+ # and they would be included into this single file.
140
+
141
+ # This is not in use in the boilerplate as it stands. You may
142
+ # choose to name your files in this way for this advantage or
143
+ # concatenate and minify them manually.
144
+ # Disabled by default.
145
+
146
+ #<FilesMatch "\.combined\.js$">
147
+ # Options +Includes
148
+ # AddOutputFilterByType INCLUDES application/javascript application/json
149
+ # SetOutputFilter INCLUDES
150
+ #</FilesMatch>
151
+ #<FilesMatch "\.combined\.css$">
152
+ # Options +Includes
153
+ # AddOutputFilterByType INCLUDES text/css
154
+ # SetOutputFilter INCLUDES
155
+ #</FilesMatch>
156
+
157
+
158
+ # ----------------------------------------------------------------------
159
+ # Gzip compression
160
+ # ----------------------------------------------------------------------
161
+
162
+ <IfModule mod_deflate.c>
163
+
164
+ # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
165
+ <IfModule mod_setenvif.c>
166
+ <IfModule mod_headers.c>
167
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
168
+ RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
169
+ </IfModule>
170
+ </IfModule>
171
+
172
+ # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
173
+ <IfModule filter_module>
174
+ FilterDeclare COMPRESS
175
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
176
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
177
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
178
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
179
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
180
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
181
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
182
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
183
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
184
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
185
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
186
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
187
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
188
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon
189
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
190
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
191
+ FilterChain COMPRESS
192
+ FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
193
+ </IfModule>
194
+
195
+ <IfModule !mod_filter.c>
196
+ # Legacy versions of Apache
197
+ AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
198
+ AddOutputFilterByType DEFLATE application/javascript
199
+ AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
200
+ AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
201
+ AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
202
+ </IfModule>
203
+
204
+ </IfModule>
205
+
206
+
207
+ # ----------------------------------------------------------------------
208
+ # Expires headers (for better cache control)
209
+ # ----------------------------------------------------------------------
210
+
211
+ # These are pretty far-future expires headers.
212
+ # They assume you control versioning with cachebusting query params like
213
+ # <script src="application.js?20100608">
214
+ # Additionally, consider that outdated proxies may miscache
215
+ # www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
216
+
217
+ # If you don't use filenames to version, lower the CSS and JS to something like
218
+ # "access plus 1 week" or so.
219
+
220
+ <IfModule mod_expires.c>
221
+ ExpiresActive on
222
+
223
+ # Perhaps better to whitelist expires rules? Perhaps.
224
+ ExpiresDefault "access plus 1 month"
225
+
226
+ # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
227
+ ExpiresByType text/cache-manifest "access plus 0 seconds"
228
+
229
+ # Your document html
230
+ ExpiresByType text/html "access plus 0 seconds"
231
+
232
+ # Data
233
+ ExpiresByType text/xml "access plus 0 seconds"
234
+ ExpiresByType application/xml "access plus 0 seconds"
235
+ ExpiresByType application/json "access plus 0 seconds"
236
+
237
+ # Feed
238
+ ExpiresByType application/rss+xml "access plus 1 hour"
239
+ ExpiresByType application/atom+xml "access plus 1 hour"
240
+
241
+ # Favicon (cannot be renamed)
242
+ ExpiresByType image/x-icon "access plus 1 week"
243
+
244
+ # Media: images, video, audio
245
+ ExpiresByType image/gif "access plus 1 month"
246
+ ExpiresByType image/png "access plus 1 month"
247
+ ExpiresByType image/jpg "access plus 1 month"
248
+ ExpiresByType image/jpeg "access plus 1 month"
249
+ ExpiresByType video/ogg "access plus 1 month"
250
+ ExpiresByType audio/ogg "access plus 1 month"
251
+ ExpiresByType video/mp4 "access plus 1 month"
252
+ ExpiresByType video/webm "access plus 1 month"
253
+
254
+ # HTC files (css3pie)
255
+ ExpiresByType text/x-component "access plus 1 month"
256
+
257
+ # Webfonts
258
+ ExpiresByType application/x-font-ttf "access plus 1 month"
259
+ ExpiresByType font/opentype "access plus 1 month"
260
+ ExpiresByType application/x-font-woff "access plus 1 month"
261
+ ExpiresByType image/svg+xml "access plus 1 month"
262
+ ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
263
+
264
+ # CSS and JavaScript
265
+ ExpiresByType text/css "access plus 1 year"
266
+ ExpiresByType application/javascript "access plus 1 year"
267
+
268
+ <IfModule mod_headers.c>
269
+ Header append Cache-Control "public"
270
+ </IfModule>
271
+
272
+ </IfModule>
273
+
274
+
275
+
276
+ # ----------------------------------------------------------------------
277
+ # ETag removal
278
+ # ----------------------------------------------------------------------
279
+
280
+ # FileETag None is not enough for every server.
281
+ <IfModule mod_headers.c>
282
+ Header unset ETag
283
+ </IfModule>
284
+
285
+ # Since we're sending far-future expires, we don't need ETags for
286
+ # static content.
287
+ # developer.yahoo.com/performance/rules.html#etags
288
+ FileETag None
289
+
290
+
291
+
292
+ # ----------------------------------------------------------------------
293
+ # Stop screen flicker in IE on CSS rollovers
294
+ # ----------------------------------------------------------------------
295
+
296
+ # The following directives stop screen flicker in IE on CSS rollovers - in
297
+ # combination with the "ExpiresByType" rules for images (see above). If
298
+ # needed, un-comment the following rules.
299
+
300
+ # BrowserMatch "MSIE" brokenvary=1
301
+ # BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1
302
+ # BrowserMatch "Opera" !brokenvary
303
+ # SetEnvIf brokenvary 1 force-no-vary
304
+
305
+
306
+
307
+ # ----------------------------------------------------------------------
308
+ # Cookie setting from iframes
309
+ # ----------------------------------------------------------------------
310
+
311
+ # Allow cookies to be set from iframes (for IE only)
312
+ # If needed, uncomment and specify a path or regex in the Location directive
313
+
314
+ # <IfModule mod_headers.c>
315
+ # <Location />
316
+ # Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
317
+ # </Location>
318
+ # </IfModule>
319
+
320
+
321
+
322
+ # ----------------------------------------------------------------------
323
+ # Start rewrite engine
324
+ # ----------------------------------------------------------------------
325
+
326
+ # Turning on the rewrite engine is necessary for the following rules and features.
327
+ # FollowSymLinks must be enabled for this to work.
328
+
329
+ <IfModule mod_rewrite.c>
330
+ Options +FollowSymlinks
331
+ RewriteEngine On
332
+ </IfModule>
333
+
334
+
335
+
336
+ # ----------------------------------------------------------------------
337
+ # Suppress or force the "www." at the beginning of URLs
338
+ # ----------------------------------------------------------------------
339
+
340
+ # The same content should never be available under two different URLs - especially not with and
341
+ # without "www." at the beginning, since this can cause SEO problems (duplicate content).
342
+ # That's why you should choose one of the alternatives and redirect the other one.
343
+
344
+ # By default option 1 (no "www.") is activated. Remember: Shorter URLs are sexier.
345
+ # no-www.org/faq.php?q=class_b
346
+
347
+ # If you rather want to use option 2, just comment out all option 1 lines
348
+ # and uncomment option 2.
349
+ # IMPORTANT: NEVER USE BOTH RULES AT THE SAME TIME!
350
+
351
+ # ----------------------------------------------------------------------
352
+
353
+ # Option 1:
354
+ # Rewrite "www.example.com -> example.com"
355
+
356
+ <IfModule mod_rewrite.c>
357
+ RewriteCond %{HTTPS} !=on
358
+ RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
359
+ RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
360
+ </IfModule>
361
+
362
+ # ----------------------------------------------------------------------
363
+
364
+ # Option 2:
365
+ # To rewrite "example.com -> www.example.com" uncomment the following lines.
366
+ # Be aware that the following rule might not be a good idea if you
367
+ # use "real" subdomains for certain parts of your website.
368
+
369
+ # <IfModule mod_rewrite.c>
370
+ # RewriteCond %{HTTPS} !=on
371
+ # RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
372
+ # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
373
+ # </IfModule>
374
+
375
+
376
+
377
+ # ----------------------------------------------------------------------
378
+ # Built-in filename-based cache busting
379
+ # ----------------------------------------------------------------------
380
+
381
+ # If you're not using the build script to manage your filename version revving,
382
+ # you might want to consider enabling this, which will route requests for
383
+ # /css/style.20110203.css to /css/style.css
384
+
385
+ # To understand why this is important and a better idea than all.css?v1231,
386
+ # read: github.com/h5bp/html5-boilerplate/wiki/Version-Control-with-Cachebusting
387
+
388
+ # Uncomment to enable.
389
+ # <IfModule mod_rewrite.c>
390
+ # RewriteCond %{REQUEST_FILENAME} !-f
391
+ # RewriteCond %{REQUEST_FILENAME} !-d
392
+ # RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L]
393
+ # </IfModule>
394
+
395
+
396
+
397
+ # ----------------------------------------------------------------------
398
+ # Prevent SSL cert warnings
399
+ # ----------------------------------------------------------------------
400
+
401
+ # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
402
+ # https://www.example.com when your cert only allows https://secure.example.com
403
+ # Uncomment the following lines to use this feature.
404
+
405
+ # <IfModule mod_rewrite.c>
406
+ # RewriteCond %{SERVER_PORT} !^443
407
+ # RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
408
+ # </IfModule>
409
+
410
+
411
+
412
+ # ----------------------------------------------------------------------
413
+ # Prevent 404 errors for non-existing redirected folders
414
+ # ----------------------------------------------------------------------
415
+
416
+ # without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
417
+ # e.g. /blog/hello : webmasterworld.com/apache/3808792.htm
418
+
419
+ Options -MultiViews
420
+
421
+
422
+
423
+ # ----------------------------------------------------------------------
424
+ # Custom 404 page
425
+ # ----------------------------------------------------------------------
426
+
427
+ # You can add custom pages to handle 500 or 403 pretty easily, if you like.
428
+ ErrorDocument 404 /404.html
429
+
430
+
431
+
432
+ # ----------------------------------------------------------------------
433
+ # UTF-8 encoding
434
+ # ----------------------------------------------------------------------
435
+
436
+ # Use UTF-8 encoding for anything served text/plain or text/html
437
+ AddDefaultCharset utf-8
438
+
439
+ # Force UTF-8 for a number of file formats
440
+ AddCharset utf-8 .html .css .js .xml .json .rss .atom .txt
441
+
442
+
443
+
444
+ # ----------------------------------------------------------------------
445
+ # A little more security
446
+ # ----------------------------------------------------------------------
447
+
448
+
449
+ # Do we want to advertise the exact version number of Apache we're running?
450
+ # Probably not.
451
+ ## This can only be enabled if used in httpd.conf - It will not work in .htaccess
452
+ # ServerTokens Prod
453
+
454
+
455
+ # "-Indexes" will have Apache block users from browsing folders without a default document
456
+ # Usually you should leave this activated, because you shouldn't allow everybody to surf through
457
+ # every folder on your server (which includes rather private places like CMS system folders).
458
+ <IfModule mod_autoindex.c>
459
+ Options -Indexes
460
+ </IfModule>
461
+
462
+
463
+ # Block access to "hidden" directories whose names begin with a period. This
464
+ # includes directories used by version control systems such as Subversion or Git.
465
+ <IfModule mod_rewrite.c>
466
+ RewriteRule "(^|/)\." - [F]
467
+ </IfModule>
468
+
469
+
470
+ # Block access to backup and source files
471
+ # This files may be left by some text/html editors and
472
+ # pose a great security danger, when someone can access them
473
+ <FilesMatch ".(bak|config|sql|fla|psd|ini|log|sh|inc|~|swp)$">
474
+ Order allow,deny
475
+ Deny from all
476
+ Satisfy All
477
+ </FilesMatch>
478
+
479
+
480
+ # If your server is not already configured as such, the following directive
481
+ # should be uncommented in order to set PHP's register_globals option to OFF.
482
+ # This closes a major security hole that is abused by most XSS (cross-site
483
+ # scripting) attacks. For more information: http://php.net/register_globals
484
+ #
485
+ # IF REGISTER_GLOBALS DIRECTIVE CAUSES 500 INTERNAL SERVER ERRORS :
486
+ #
487
+ # Your server does not allow PHP directives to be set via .htaccess. In that
488
+ # case you must make this change in your php.ini file instead. If you are
489
+ # using a commercial web host, contact the administrators for assistance in
490
+ # doing this. Not all servers allow local php.ini files, and they should
491
+ # include all PHP configurations (not just this one), or you will effectively
492
+ # reset everything to PHP defaults. Consult www.php.net for more detailed
493
+ # information about setting PHP directives.
494
+
495
+ # php_flag register_globals Off
496
+
497
+ # Rename session cookie to something else, than PHPSESSID
498
+ # php_value session.name sid
499
+
500
+ # Do not show you are using PHP
501
+ # Note: Move this line to php.ini since it won't work in .htaccess
502
+ # php_flag expose_php Off
503
+
504
+ # Level of log detail - log all errors
505
+ # php_value error_reporting -1
506
+
507
+ # Write errors to log file
508
+ # php_flag log_errors On
509
+
510
+ # Do not display errors in browser (production - Off, development - On)
511
+ # php_flag display_errors Off
512
+
513
+ # Do not display startup errors (production - Off, development - On)
514
+ # php_flag display_startup_errors Off
515
+
516
+ # Format errors in plain text
517
+ # Note: Leave this setting 'On' for xdebug's var_dump() output
518
+ # php_flag html_errors Off
519
+
520
+ # Show multiple occurrence of error
521
+ # php_flag ignore_repeated_errors Off
522
+
523
+ # Show same errors from different sources
524
+ # php_flag ignore_repeated_source Off
525
+
526
+ # Size limit for error messages
527
+ # php_value log_errors_max_len 1024
528
+
529
+ # Don't precede error with string (doesn't accept empty string, use whitespace if you need)
530
+ # php_value error_prepend_string " "
531
+
532
+ # Don't prepend to error (doesn't accept empty string, use whitespace if you need)
533
+ # php_value error_append_string " "
534
+
535
+ # Increase cookie security
536
+ <IfModule php5_module>
537
+ php_value session.cookie_httponly true
538
+ </IfModule>