Skip to content

Instantly share code, notes, and snippets.

/* this selects every p tag and makes them all 600px wide and have a margin of 20px */
p {
width: 600px;
margin: 20px;
}
/* the hash symbol looks for a tag with an id="intro" in your HTML, this gives it a width of 300px and a background color red */
#intro {
# So this is in control_word.rb
class ControlWord < ActiveRecord::Base
def self.exists?(word)
find_by_text(word)
end
def self.positive?
self.status == "positive"
control_words = ControlWord.create([
{:text => 'death', :status => 'negative'},
{:text => 'murder', :status => 'negative'},
{:text => 'war', :status => 'negative'},
{:text => 'dead', :status => 'negative'},
{:text => 'crisis', :status => 'negative'},
{:text => 'threat', :status => 'negative'},
{:text => 'bomb', :status => 'negative'},
{:text => 'killed', :status => 'negative'},
{:text => 'protest', :status => 'negative'},
@words = []
@words = entry.title.scan(/\w+/)
@words.each do |word|
if word = ControlWord.exists?(word)
if ControlWord.new.positive?
debugger
update_attributes(:pos += 1)
else
update_attributes(:pos += 1)
end
@negentries = FeedEntry.where(:status => 'negative').where("created_at >= #{Time.zone.now.beginning_of_day.to_s(:db)}")
<% unless params[:action] == "checkout" && params[:controller] == "cart" %>
<%= render :partial => 'navigation'%>
<% end %>
#nav {
#navbar {
ul {
li.active {
a.nav-2 {
&:hover {
}
}
rvm install 1.9.2
gem install bundler
gem install rails
bundle install
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Tommy/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.h... *** extconf.rb failed ***
HOMEBREW_VERSION: 0.8
HEAD: c65b3511fb664081de252779de096147aed7fcfb
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: dual-core 64-bit penryn
OS X: 10.7.2
Kernel Architecture: x86_64
Ruby: 1.8.7-249