NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
| @import compass/css3/transform | |
| .blueimp-gallery | |
| .video-js-box.video-content | |
| +transform-style(preserve-3d) | |
| .video-js.vjs-default-skin | |
| +translate(-50%, -50%) | |
| position: absolute | |
| left: 50% |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
| module SimpleForm | |
| module Inputs | |
| class DatePickerInput < SimpleForm::Inputs::StringInput | |
| def input_html_options | |
| value = object.send(attribute_name) | |
| options = { | |
| value: value.nil?? nil : I18n.localize(value, format: :datepicker), | |
| data: { | |
| behaviour: 'datepicker' | |
| } |
| module CancanLinkHelper | |
| def show_link(*args, &block) | |
| if block_given? && can?(:read, args[0]) | |
| object = args[0] | |
| html_options = args[1] || {} | |
| show_link(object, capture(&block), html_options) | |
| elsif can?(:read, args[0]) | |
| object = args[0] | |
| content = args[1] || glyph(:eye_open) |
| #!/bin/bash | |
| # sidekiq Init script for Sidekiq | |
| # chkconfig: 345 100 75 | |
| # | |
| # Description: Starts and Stops Sidekiq message processor for Stratus application. | |
| # | |
| # User-specified exit parameters used in this script: | |
| # | |
| # Exit Code 5 - Incorrect User ID | |
| # Exit Code 6 - Directory not found |
| module AuthHelper | |
| def http_login | |
| user = 'username' | |
| pw = 'password' | |
| request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw) | |
| end | |
| end | |
| module AuthRequestHelper | |
| # |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
| # A class-based template for jQuery plugins in Coffeescript | |
| # | |
| # $('.target').myPlugin({ paramA: 'not-foo' }); | |
| # $('.target').myPlugin('myMethod', 'Hello, world'); | |
| # | |
| # Check out Alan Hogan's original jQuery plugin template: | |
| # https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template | |
| # | |
| (($, window) -> |