This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
This runs provides an .optim job for dragonfly and also adds the .optim job into .thumb
This requires you have the 'image_optim' gem and it's dependencies.
| #!/usr/bin/env ruby | |
| require 'rails/generators' | |
| require 'rails/generators/rails/app/app_generator' | |
| require "active_support/core_ext/string/strip" | |
| class CleverAppGenerator < Rails::Generators::AppGenerator | |
| class_option :skip_bundle, default: true | |
| class_option :database, default: "postgresql" | |
| class_option :skip_test_unit, default: true, hide: true |
| # ... | |
| config.middleware.insert_before "Rack::Cache", "SkipCache" | |
| # ... |
Originally published in June 2008
When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.
To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.
Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.
| # http://stackoverflow.com/questions/14972253/simpleform-default-input-class | |
| # https://github.com/plataformatec/simple_form/issues/316 | |
| inputs = %w[ | |
| CollectionSelectInput | |
| DateTimeInput | |
| FileInput | |
| GroupedCollectionSelectInput | |
| NumericInput | |
| PasswordInput |
| inputs = %w[ | |
| CollectionSelectInput | |
| DateTimeInput | |
| FileInput | |
| GroupedCollectionSelectInput | |
| NumericInput | |
| PasswordInput | |
| RangeInput | |
| StringInput | |
| TextInput |
| require 'yaml' | |
| require 'erb' | |
| require 'ostruct' | |
| class Settings < OpenStruct | |
| # Settings.new(:google_analytics) | |
| def initialize(config_file_base_name) | |
| super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env]) | |
| end |
| module RailsTemplate | |
| module Gem | |
| extend self | |
| def use(name, options={}) | |
| require_path = options[:require] || name | |
| begin | |
| require require_path | |
| rescue LoadError | |
| system "gem install #{name}" |
Options included below:
docker-composebrewThis gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.
I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.
There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:
:vs **/*<partial file name><Tab>