gem install rails --pre
rails new my_app -T
| # Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html | |
| Hi everyone, I'm Chris Wanstrath. | |
| When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But | |
| then I took a few moments and thought, Wait, why? Why me? What am I supposed | |
| to say that's interesting? Something about Ruby, perhaps. Maybe the | |
| future of it. The future of something, at least. That sounds | |
| keynote-y. | |
| # 1) Point *.example.com in your DNS setup to your server. | |
| # | |
| # 2) Setup an Apache vhost to catch the star pointer: | |
| # | |
| # <VirtualHost *:80> | |
| # ServerName *.example.com | |
| # </VirtualHost> | |
| # | |
| # 3) Set the current account from the subdomain | |
| class ApplicationController < ActionController::Base |
| /* | |
| * Copyright © 2009, Componentix. All rights reserved. | |
| */ | |
| package com.componentix.hibernate.dialect; | |
| import java.sql.Types; | |
| /** | |
| * A proper dialect for Microsoft SQL Server 2000 and 2005. |
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Update 7 Oct 2010: | |
| # - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
| # the WebSocket protocol implementation in the cramp gem does not work | |
| # well with Chrome's (newer) WebSocket implementation. | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
| worker: QUEUE=* bundle exec rake environment resque:work | |
| scheduler: bundle exec rake environment resque:scheduler |
| # How to sign your custom RPM package with GPG key | |
| # Step: 1 | |
| # Generate gpg key pair (public key and private key) | |
| # | |
| # You will be prompted with a series of questions about encryption. | |
| # Simply select the default values presented. You will also be asked | |
| # to create a Real Name, Email Address and Comment (comment optional). | |
| # | |
| # If you get the following response: |
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |
| ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
| html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe | |
| # add nokogiri gem to Gemfile | |
| elements = Nokogiri::HTML::DocumentFragment.parse(html_tag).css "label, input" | |
| elements.each do |e| | |
| if e.node_name.eql? 'label' | |
| html = %(<div class="clearfix error">#{e}</div>).html_safe | |
| elsif e.node_name.eql? 'input' | |
| if instance.error_message.kind_of?(Array) | |
| html = %(<div class="clearfix error">#{html_tag}<span class="help-inline"> #{instance.error_message.join(',')}</span></div>).html_safe |
| # CentOS 6.4 barebones walkthrough guide for a new vps rails server instance | |
| # assumes you already have a personal ssh key locally | |
| # | |
| # script implements the following security approaches: | |
| # disables root login | |
| # configures ssh setup for deployer user | |
| # opens up standard ports | |
| # | |
| # setup includes: | |
| # rvm & ruby-1.9.3-p429 |