You can use Chef or Puppet to build out your infrastructure, but if you just need a quick and dirty box set up,
First, download Vagrant and install it.
After that, visit your DigitalOcean account and obtain your API key.
ENV["RAILS_ENV"] = "test" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'shoulda' | |
require 'webrat' | |
require 'factory_girl' | |
require 'test/factories/clearance' | |
require 'clearance/../../shoulda_macros/clearance' | |
require 'cucumber/rails/world' | |
Cucumber::Rails.use_transactional_fixtures | |
njero - http://neverlet.be | |
sutto - http://blog.ninjahideout.com | |
zapnap - http://blog.zerosum.org | |
tpope - http://tpope.net | |
reinh - http://reinh.com | |
bryanl - http://smartic.us | |
linoj - http://www.vaporbase.com | |
technicalpickles - http://technicalpickles.com | |
MaD15 - enlightsolutions.com/ | |
qrush - http://litanyagainstfear.com/ |
site = ARGV[0] | |
raise "Fail." if site.nil? || site == "" | |
`staticmatic setup #{site}` | |
Dir.chdir(site) | |
`wget http://960.gs/files/960_download.zip` | |
`unzip 960_download.zip` | |
`rm 960_download.zip` | |
`mv 960_download/code/css/*.css site/stylesheets` | |
`rm -rf 960_download` |
# Scans your project for CSS and JS files and | |
# runs them through the Yahoo Compression utility | |
# and then uploads the entire site to your web server via SCP. | |
# Install prerequisites: | |
# sudo gem install net-scp | |
# Download http://www.julienlecomte.net/yuicompressor/ | |
# Create a bin/ folder and place the following files from the download into the folder: |
def belongs_to(association_id, options = {}) | |
association_column = options[:foreign_key] ||= association_id.to_s + "_id" # | |
reflection = create_belongs_to_reflection(association_id, options) | |
if reflection.options[:polymorphic] | |
association_accessor_methods(reflection, BelongsToPolymorphicAssociation) | |
else | |
association_accessor_methods(reflection, BelongsToAssociation) | |
association_constructor_method(:build, reflection, BelongsToAssociation) | |
association_constructor_method(:create, reflection, BelongsToAssociation) |
class Person | |
def say_hello | |
"Hello" | |
end | |
end | |
class Person | |
def say_goodbye | |
"goodbye" | |
end |
# Main sinatra app | |
require 'sinatra' | |
require 'activerecord' | |
require 'activesupport' | |
include ActionView::Helpers::DateHelper # add the required helpers here. | |
require 'controllers.rb' | |
# controllers.rb |
I'm looking for your help to help me understand React better.
I have an idea for a simple app. It’s based on an educational activity I did in a training session once, and I think it’s a good opportunity for me to learn React.
Here’s the premise. You’re given a shuffled deck of cards. Each card has a type of activity on the card and is a certain color based on the type of learning preference it targets. For example one card may say “You use music during breaks”. You go through the card and place all the ones you actively do in your classroom into one pile, and place the ones you don’t in the discard pile. At the end of the activity, you have a clearer picture of what learning preferences you target, and what preferences you don’t. And you get ideas for activities to do in the classroom.
I thought making a digital version of this would work well. The app would present each card to you and ask you if you do that activity. When you’re all done, the cards would be displayed in both piles.
Here’s where I n
#!/usr/bin/env ruby | |
require 'rubygems' | |
gems = Gem.source_index.search(Gem::Dependency.new(//, Gem::Requirement.default)) | |
gems.each do |gem| | |
puts "gem '#{gem.name}', '#{gem.version.to_s}'" | |
end |