Friday, February 21, 2014

ruby on rails - CSS is not working after push to heroku but works on localhost - Stack Overflow

ruby on rails - CSS is not working after push to heroku but works on localhost - Stack Overflow: "When I do a element inspection in your Heroku page, I do see the change in style (padding 5px....) Did you check that you are update you pre-compiled assets (as I see you have the application....css is our header. You should give a shot at using the following command :

RAILS_ENV=production bundle exec rake assets:precompile"



'via Blog this'

h5bp/html5-boilerplate

h5bp/html5-boilerplate: "A professional front-end template for building fast, robust, and adaptable web apps or sites.
http://html5boilerplate.com/"



'via Blog this'

Guide to HTML5 Boilerplate for Rails Developers · RailsApps

Guide to HTML5 Boilerplate for Rails Developers · RailsApps: "CSS Helper Classes
The HTML5 Boilerplate style.css file includes several CSS classes that are often needed by web designers. You’ll probably use some of these if you are not using another CSS toolkit.

HTML5 Boilerplate’s image-replacement
HTML5 Boilerplate’s hidden
HTML5 Boilerplate’s visuallyhidden
HTML5 Boilerplate’s invisible
HTML5 Boilerplate’s clearfix"



'via Blog this'

Foundation Docs

Foundation Docs: "Whichever of those options you choose, you'll receive a .zip archive containing the following files:

index.html — This is an example index file which contains some sample markup (the grid, buttons, etc) as well as the basic structure of a responsive Foundation page. Feel free to change or destroy this file as you see fit, just bear in mind that some of the document

Ruby On Rails with HTML5 and CSS3 - Stack Overflow

Ruby On Rails with HTML5 and CSS3 - Stack Overflow: "I recommend you to get started with Guide to HTML5 Boilerplate for Rails Developers"



'via Blog this'

What is Ruby on Rails? · RailsApps

What is Ruby on Rails? · RailsApps: "At a higher level of abstraction, programmers find that code can be often be optimally organized according to patterns that other experienced developers will recognize. Code is easier to write when it fits a pattern you’ve encountered before; it’s easier to analyze and understand code that another programmer has written if it matches a widely known software design pattern. "



'via Blog this'

Thursday, February 20, 2014

What should I learn along with Ruby on Rails? - Stack Overflow

What should I learn along with Ruby on Rails? - Stack Overflow: "I think I've seen just about every Rails tutorial there is (at least the most well known).

My favorite is the Rails Tutorial by Michael Hartl: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

The best part is, it's free - as in beer. But it's also very thorough. I've gone through it at least twice to get concepts that I had a hard time with the first time around.

As you go through it, you'll learn Ruby concepts, Rails concepts, and a little CSS and Javascript."



'via Blog this'

Link to other pages wih same controller using Ruby on Rails - Stack Overflow

Link to other pages wih same controller using Ruby on Rails - Stack Overflow: "<%= link_to 'link_name', :action => 'Your_method_name', :controller => 'custom_hello' %>"



'via Blog this'

Link to other pages wih same controller using Ruby on Rails - Stack Overflow

Link to other pages wih same controller using Ruby on Rails - Stack Overflow: "Here it is:

app/controllers/custom_hello_controller.rb

class CustomHelloController < ApplicationController
def method1
end

def method2
end
end
config/routes.rb

get 'custom_hello/method1'
get 'custom_hello/method2'
Create 2 files in your views:

app/views/custom_hello/method1.html.erb
app/views/custom_hello/method2.html.erb
You can create links with:

<%= link_to 'Method 1', custom_hello_method1_path %>
<%= link_to 'Method 2', custom_hello_method2_path %>"



'via Blog this'

Rails 4 images not loading on heroku - Stack Overflow

Rails 4 images not loading on heroku - Stack Overflow: "I need to combine several solutions to make it worked, here are what I did:

on Gemfile:

gem 'rails_12factor', group: :production
on Heroku console:

heroku labs:enable user-env-compile -a yourapp
on production.rb

config.serve_static_assets = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
config.assets.compile = true
and I didn't need to precompile the assets locally."



'via Blog this'

css - Heroku does not serve background image, localhost does? - Stack Overflow

css - Heroku does not serve background image, localhost does? - Stack Overflow: "Make sure you set these in your production.rb file

config.cache_classes = true
config.serve_static_assets = true
config.assets.compile = true
config.assets.digest = true"



'via Blog this'

Building a Rails 3 Application with Memcache | Heroku Dev Center

Building a Rails 3 Application with Memcache | Heroku Dev Center: "Install the MemCachier add-on and configure caching

As noted in the MemCachier article, you need to install the add-on and the dalli gem. The optional memcachier gem is also recommended.
At the terminal, run:"



'via Blog this'

Learn Web Development with the Ruby on Rails Tutorial | A Demo App

Learn Web Development with the Ruby on Rails Tutorial | A Demo App: "# This should only be used if your Heroku deploy fails without it.
$ rake assets:precompile
$ git add .
$ git commit -m "Add precompiled assets for Heroku"
$ git push heroku master
This shouldn’t be necessary, and I have been unable to reproduce the issue, but the reports are common enough that I include it here for reference.)

To get the application’s database to work, you’ll also have to migrate the production database:

$ heroku run rake db:migrate"



'via Blog this'

mduvall/quizlet-ruby

mduvall/quizlet-ruby:



'via Blog this'

Rails 3 using Devise: How to allow someone to log in using their Facebook account? - Stack Overflow

Rails 3 using Devise: How to allow someone to log in using their Facebook account? - Stack Overflow: "I have a Rails 3 application using Devise for authentication. Now I need to allow someone to log in using their Facebook account. I think this is called Facebook Connect, but I've also heard the term Facebook Graph API, so I'm not sure which one I'm asking for.

What do I need to do in order to integrate Facebook Connect with Devise?

Solution:

This question is pretty old now. A year ago, Devise v1.2 introduced OmniAuth support. Now Devise is at v2.1 (as of this writing) and using OmniAuth is even easier. Here is a great tutorial from the Devise wiki on using the omniauth-facebook gem with Devise to allow sign-in using Facebook."



'via Blog this'

Wednesday, February 19, 2014

rubygems - list of all/best gems for Ruby? - Stack Overflow

rubygems - list of all/best gems for Ruby? - Stack Overflow: "I don't know about "best," but if you want to see a list of commonly used gems for various purposes, I've found The Ruby Toolbox to be a great resource. The rankings are determined by counting up the number of forks and watchers of various github projects, so I'd view it less as "this is what I should be using," and more as "these are some things I should check out." At the very least, they're all likely to be under active development and fairly up to date, and it's very useful to see groups of gems broken down by category."



'via Blog this'

Contributing to RubyGems - RubyGems Guides

Contributing to RubyGems - RubyGems Guides:



'via Blog this'

Contributing to RubyGems - RubyGems Guides

Contributing to RubyGems - RubyGems Guides:



'via Blog this'

Goldlist Method | Huliganov TV

Goldlist Method | Huliganov TV: "15. Again, you do nothing with the words of the first distillation for a period of at least two weeks (this is why you always date when you do the distillations also) and not more than two months (same reasons as given above) and then, when that time comes, you go back to the first distillations on the top of the right side page, and make from them the second distillation on the bottom of the right hand page. From those 17 words you will be looking at keeping 12 and discarding or merging 5. Again, first plan and ask yourself “which 5 of these seventeen words did I remember best?” and put a cross next to them, don’t write them out again. It is a game with "



'via Blog this'

Vocabulary Lesson Ideas- Ideas for Teaching, Resources for Lesson Plans, and Activities for Unit Planning

Vocabulary Lesson Ideas- Ideas for Teaching, Resources for Lesson Plans, and Activities for Unit Planning: " love vocab games. Here are some things I do in class:

1. Vocabulary Bingo -- Students can write their vocabulary words in a bingo sheet and you call out the words.

2. Last week, I had two students sit in front of the class. Their chairs faced the rest of the classroom. On the board behind them (so they couldn't see) I wrote down one of our vocab words. The class was divided into 2 teams. Each time had 5 chances to give clues so the student could guess the word. For example, if the word is frantic--they would say wild, emotional, etc. I only allowed them to give one word clues, which es"



'via Blog this'

search | RubyGems.org | your community gem host

search | RubyGems.org | your community gem host: "Displaying all 2 gems

843 downloads
omniauth-quizlet (0.0.1)
quizlet omniauth strategy
429 downloads
quizlet-ruby (0.0.1)
A Ruby wrapper for the Quizlet 2.0 API"



'via Blog this'

Buying a home? FAQ about closing costs and mortgage loans American Heritage Bank - Story

Buying a home? FAQ about closing costs and mortgage loans American Heritage Bank - Story: "Some common types of fees include:

Appraisal fee
Credit report fee
Recording fee
Title insurance
Loan discount points
Attorney's fee"



'via Blog this'

ActionController::RoutingError (No route matches [GET] "/favicon.ico") in Rails - Stack Overflow

ActionController::RoutingError (No route matches [GET] "/favicon.ico") in Rails - Stack Overflow: "
Manually place the favicion.ico file in the public/ directory of your application.
Put the favicon.ico in app/assets/images/ and then change your " rel="shortcut icon" />
This will place the favicon.ico in public/assets/favicon.ico, not in the document root.

I suggest sticking with #1 above."



'via Blog this'

HTML: adding a website address bar icon or favicon | a Tech-Recipes Tutorial

HTML: adding a website address bar icon or favicon | a Tech-Recipes Tutorial: "Create Your Icon:
First you are going to need an image:
-using your favorite photo editing program resize it to 16×16 and save it as a .bmp file.

-next open it with paint or some other basic editing software that will not try to add anything to the file as photoshop and some other high end programs do, in the transfer from .jpg and .gif to .bmp and resave it, replaceing the old .bmp file.

-now that you have a proper likely 24-bit .bmp save the file -again with paint- only save it as the following:
favicon.ico"



'via Blog this'

html - Adding Icon to rails website? - Stack Overflow

html - Adding Icon to rails website? - Stack Overflow: "<%= favicon_link_tag %>
Or if you want another image than favicon.ico

<%= favicon_link_tag 'another_image.ico' %>
share|improve this answer
answered May 25 '11 at 20:57

JCorcuera
3,21211419
 
Simple, but great 'as the rails way' answer. –  Cadence96 Mar 10 '12 at 8:49
3  
I'd just like to add that the favicon.ico file should go in the public directory and documentation can be found here: apidock.com/rails/ActionView/Helpers/AssetTagHelper/… –  David Grayson Sep 19 '12 at 22:20
add comment
"



'via Blog this'

Git for developers - MoodleDocs

Git for developers - MoodleDocs: "git checkout master"
then do a git pull to merge the head with production



'via Blog this'

How do I fix merge conflicts in Git? - Stack Overflow

How do I fix merge conflicts in Git? - Stack Overflow: "FYI you can use git mergetool"



'via Blog this'

version control - What's the best visual merge tool for Git? - Stack Overflow

version control - What's the best visual merge tool for Git? - Stack Overflow: "Meld is a good diff/merge tool.

Here's how to install it on:

Ubuntu
Mac"



'via Blog this'

Git With Meld Diff Viewer on Ubuntu - Wired For Code

Git With Meld Diff Viewer on Ubuntu - Wired For Code: "Save this to a location such as /usr/local/bin, giving it executable rights:

$ sudo mv git-diff.sh /usr/local/bin/
$ sudo chmod +x /usr/local/bin/git-diff.sh
The final step is to open your $HOME/.gitconfig file and add the following few lines:

"



'via Blog this'

Git Mergetool - Merging With a GUI - GitGuys - GitGuys

Git Mergetool - Merging With a GUI - GitGuys - GitGuys: "Merging With a GUI
Git can also work with a large number of GUI tools for helping with merging. A couple of popular GUI tools used on Linux are kdiff3 and meld. They are worth trying (you may need to install them if they aren’t installed yet).
Back To The Same Old Conflict
We’ll go back to the conflict in the the second line of the README file, from our repository as described in the Merging Branches With a Conflict page.
Merging with kdiff3
If you want to try out kdiff3 you could type:"



'via Blog this'

Git With Meld Diff Viewer on Ubuntu - Wired For Code

Git With Meld Diff Viewer on Ubuntu - Wired For Code: "sudo apt-get update && sudo apt-get install meld"



'via Blog this'

How to move the current working branch to master branch in git - Stack Overflow

How to move the current working branch to master branch in git - Stack Overflow: "Firstly, I would try just merging it to master and seeing if there really are lots of conflicts - git's merging is great at only marking genuine conflicts. If you make sure that your git status is clean before you start, and you find that there are too many conflicts to deal with, you can just go back with:

git reset --merge
However, if you just want to make your current master the same as your other branch, you could do that with:

git checkout master
git reset --hard other-branch
However, that's generally a bad idea since:"



'via Blog this'

Rails eBooks - Free Download IT eBooks

Rails eBooks - Free Download IT eBooks: "Beginning Rails 4, 3rd Edition

Beginning Rails 4 is a book that will guide you from never having programmed with Ruby, to having a Rails application built and deployed to the web. You'll learn how to combine all the components of Rails to develop your own web applications. You will use test driven development to make sure your application works exactly like you expect. You will learn how to use Git for source control and best practice techniques to create applications like a pro. Essential, and often-missed, information on testing and learning to program with Ruby are also covered. This book is well suited for someone with little to no Ruby or Rails experience, or possibly even someone with no experience developing web applications at all. Beginning Rails 4 does assume a basic familiarity with the web and typical web terms, but doesn't require you to be an expert of these."



'via Blog this'

Tuesday, February 18, 2014

Do those air purifiers / ionizers really work? Is it really genuine science at work here?

Do those air purifiers / ionizers really work? Is it really genuine science at work here?: "Most reviews agree that those with severe allergies, asthma and bronchitis -- who need to control indoor air quality as much as possible -- may benefit the most from air purifiers, but only when used in conjunction with other allergen source-control strategies, including ventilation and daily HEPA vacuuming. These reviews say there’s little evidence that air purifiers are effective alone. The Allergy and Asthma Network/Mothers of Asthmatics takes this stance: "Air filters don’t replace the need for eliminating or reducing indoor allergens. Beware of any manufacturer making health claims.""



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "7.1 Basic Structures
The two basic structures are arrays and hashes. Hashes mirror the syntax used for accessing the value in params. For example if a form contains


the params hash will contain

"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "The form builder used also determines what happens when you do

<%= render partial: f %>"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "class LabellingFormBuilder < ActionView::Helpers::FormBuilder
  def text_field(attribute, options={})
    label(attribute) + super
  end
end
If you reuse this frequently you could define a labeled_form_for helper that automatically applies the builder: LabellingFormBuilder option."



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "5.2 Dealing with Ajax
Unlike other forms making an asynchronous file upload form is not as simple as providing form_for with remote: true. With an Ajax form the serialization is done by JavaScript running inside the browser and since JavaScript cannot read files from your hard drive the file cannot be uploaded. The most common workaround is to use an invisible iframe that serves as the target for the form submission."



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "The above inputs would result in params[:start_date] being a hash with keys :year, :month, :day. To get an actual Time or Date object you would have to extract these values and pass them to the appropriate constructor, for example

Date.civil(params[:start_date][:year].to_i, params[:start_date][:month].to_i, params[:start_date][:day].to_i)
"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "There is also time_zone_options_for_select helper for a more manual (therefore more customizable) way of doing this. Read the API documentation to learn about the possible arguments for these two methods."



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "<%= collection_select(:person, :city_id, City.all, :id, :name) %>"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "Select boxes in HTML require a significant amount of markup (one OPTION element for each option to choose from), therefore it makes the most sense for them to be dynamically generated.

Here is what the markup might look like:


  
  
  ...
  
"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "The Rails framework encourages RESTful design of your applications, which means you'll be making a lot of "PATCH" and "DELETE" requests (besides "GET" and "POST"). However, most browsers don't support methods other than "GET" and "POST" when it comes to submitting forms.

Rails works around this issue by emulating other methods over POST with a hidden input named "_method", which is set to reflect the desired method:"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "The Rails framework encourages RESTful design of your applications, which means you'll be making a lot of "PATCH" and "DELETE" requests (besides "GET" and "POST"). However, most browsers don't support methods other than "GET" and "POST" when it comes to submitting forms."



'via Blog this'

i've noticed.. | SQLite3::SQLException: table already exists

i've noticed.. | SQLite3::SQLException: table already exists: "Once you’ve started sqlite3 with the proper database, you probably know what to do:

sqlite> drop table table_name;

sqlite> .quit"



'via Blog this'

About - Bill Eisenhauer

About - Bill Eisenhauer: "I am a 48 year old guy lucky enough to have his hobby be his profession — I started programming way back as a teenager on the family’s Apple II computer and haven’t really stopped since.

I am continuously curious and interested in new technologies and usually have the latest books on the subjects that I’m interested in. I’m never a day without reading either a book or any of the countless blogs that I follow. As a result, I’m always current on the latest technical trends.


Bill and Guy Kawasaki
In addition to my love for technology, I also have "



'via Blog this'

Checking if a variable is not nil and not zero in ruby - Stack Overflow

Checking if a variable is not nil and not zero in ruby - Stack Overflow: "unless discount.nil? || discount == 0
# ...
end"



'via Blog this'

Install Plex Server on a Ubuntu Server | The K Unit

Install Plex Server on a Ubuntu Server | The K Unit: "The major benefit for using a Ubuntu Server is that it requires less memory and the Plex web interface is powerful making it quite viable to manage it without a desktop interface. The install steps for Plex on Ubuntu is also extremely painless. My Plex server is installed on a KVM virtual machine and connects to its media to my FreeNAS via NFS."



'via Blog this'

Complete Media Server Solution using Peppermint Linux and Plex: Peppermint Linux with Plex Media Server

Complete Media Server Solution using Peppermint Linux and Plex: Peppermint Linux with Plex Media Server: "With TV Shows, I am actually using a directory structure.  I.E. I will use Dexter from Showtime as an example.  Root Directory is Dexter, sub-directories are Season 1, Season 2, Season 3, etc...  each season 1 contains all video files of season 1.  Plex will figure this out and display it on your Roku or other devices organized accordingly.  "



'via Blog this'

Bug #1241811 “USB disk not automatically mounted after upgrade t...” : Bugs : “gvfs” package : Ubuntu

Bug #1241811 “USB disk not automatically mounted after upgrade t...” : Bugs : “gvfs” package : Ubuntu: "udisksctl mount --block-device /dev/sdc1"



'via Blog this'

Form Helpers — Ruby on Rails Guides

Form Helpers — Ruby on Rails Guides: "Dealing with Basic Forms
The most basic form helper is form_tag.

<%= form_tag do %>
  Form contents
<% end %>"



'via Blog this'

Monday, February 17, 2014

ActionView::PartialRenderer

ActionView::PartialRenderer: "Action View Partials

There's also a convenience method for rendering sub templates within the current controller that depends on a single object (we call this kind of sub templates for partials). It relies on the fact that partials should follow the naming convention of being prefixed with an underscore – as to separate them from regular templates that could be rendered on their own.

In a template for Advertiser#account:

<%= render partial: "account" %>"



'via Blog this'

i've noticed.. | SQLite3::SQLException: table already exists

i've noticed.. | SQLite3::SQLException: table already exists: "From the command line, your first instinct will be to start sqlite and look for the table to drop. However, the proper way to do it is to go to your Rails application directory and run the following command to open the development database for your application:

sqlite3 db/development.sqlite3 

Once you’ve started sqlite3 with the proper database, you probably know what to do:

sqlite> drop table table_name;

sqlite> .quit"



'via Blog this'

About - Bill Eisenhauer

About - Bill Eisenhauer: "I am a 48 year old guy lucky enough to have his hobby be his profession — I started programming way back as a teenager on the family’s Apple II computer and haven’t really stopped since."



'via Blog this'

The Rails Command Line — Ruby on Rails Guides

The Rails Command Line — Ruby on Rails Guides: "rails generate controller Greetings hello
     create  app/controllers/greetings_controller.rb
      route  get "greetings/hello"
     invoke  erb
     create    app/views/greetings
     create    app/views/greetings/hello.html.erb
     invoke  test_unit
     create    test/controllers/greetings_controller_test.rb
     invoke  helper
     create    app/helpers/greetings_helper.rb
     invoke    test_unit
     create      test/helpers/greetings_helper_test.rb
     invoke  assets
     invoke    coffee
     create      app/assets/javascripts/greetings.js.coffee
     invoke    scss
     create      app/assets/stylesheets/greetings.css.scss
"



'via Blog this'

Revert to previous Git commit - Stack Overflow

Revert to previous Git commit - Stack Overflow: "git checkout 0d1d7fc32
or if you want to make commits while you're there, go ahead and make a new branch while you're at it:

git checkout -b old-state 0d1d7fc32
If, on the other hand, you want to really get rid of everything you've done since then, there are two possibilities. One, if you haven't published any of these commits, simply reset:

# This will destroy any local modifications."



'via Blog this'

How do I reverse a 'rails generate'? - Stack Overflow

How do I reverse a 'rails generate'? - Stack Overflow: "rails destroy controller lalala
rails destroy model yadayada
rails destroy scaffold hohoho"



'via Blog this'

activerecord - rails generate model field:type -what are the options for field:type? - Stack Overflow

activerecord - rails generate model field:type -what are the options for field:type? - Stack Overflow: "rails generate model --help –  Dennis Jan 21 at 18:51
add comment
5 Answers
activeoldestvotes
up vote
226
down vote
accepted
:string, :text, :integer, :float, :decimal, :datetime, :timestamp, :time, :date,
:binary, :boolean, :references"



'via Blog this'

Revert to previous Git commit - Stack Overflow

Revert to previous Git commit - Stack Overflow: " This will detach your HEAD, i.e. leave you with no branch checked out:
git checkout 0d1d7fc32
or if you want to make commits while you're there, go ahead and make a new branch while you're at it:

git checkout -b old-state 0d1d7fc32"



'via Blog this'

Active Record Basics — Ruby on Rails Guides

Active Record Basics — Ruby on Rails Guides: "Database Table - Plural with underscores separating words (e.g., book_clubs).
Model Class - Singular with the first letter of each word capitalized (e.g., BookClub)."



'via Blog this'

git: undo all working dir changes including new files - Stack Overflow

git: undo all working dir changes including new files - Stack Overflow: "git reset --hard # removes staged and working directory changes

git clean -f -d # remove untracked files
git clean -f -x -d # CAUTION: as above but removes ignored files like config."



'via Blog this'

Rails Routing from the Outside In — Ruby on Rails Guides

Rails Routing from the Outside In — Ruby on Rails Guides: "Rails Routing from the Outside In
This guide covers the user-facing features of Rails routing.

After reading this guide, you will know:

How to interpret the code in routes.rb.
How to construct your own routes, using either the preferred resourceful style or the match method.
What parameters to expect an action to receive.
How to automatically create paths and URLs using route helpers.
Advanced techniques such as constraints and Rack endpoints."



'via Blog this'

Ruby/Rails - Models Named with Two Words (Naming Convention Issues) - Stack Overflow

Ruby/Rails - Models Named with Two Words (Naming Convention Issues) - Stack Overflow: "Name it PromotedEvent in the file promoted_event.rb

a = PromotedEvent.new"



'via Blog this'

Rails Routing from the Outside In — Ruby on Rails Guides

Rails Routing from the Outside In — Ruby on Rails Guides: "Because you might want to use the same controller for a singular route (/account) and a plural route (/accounts/45), singular resources map to plural controllers. So that, for example, resource :photo and resources :photos creates both singular and plural routes that map to the same controller (PhotosController)."



'via Blog this'

Rails 3 library not loading until require - Stack Overflow

Rails 3 library not loading until require - Stack Overflow: "config.autoload_paths += %W(#{config.root}/lib)
config.autoload_paths += Dir["#{config.root}/lib/**/"]"



'via Blog this'

Sunday, February 16, 2014

Ruby: defining class level hash with default values - Stack Overflow

Ruby: defining class level hash with default values - Stack Overflow: "class LogEntry
EntryType = { :error => 0, :warning => 1, :info => 2 }
end
But you want to reference it as

LogEntry::EntryType[:error]"



'via Blog this'

Ruby: defining class level hash with default values - Stack Overflow

Ruby: defining class level hash with default values - Stack Overflow: "class LogEntry
EntryType = { :error => 0, :warning => 1, :info => 2 }
end
But you want to reference it as

LogEntry::EntryType[:error]"



'via Blog this'

Ruby/Rails - How to Create a Class and Access it from the Controller - Stack Overflow

Ruby/Rails - How to Create a Class and Access it from the Controller - Stack Overflow: "You should put location.rb wherever you feel it makes the most sense. Having it at app/models/location.rb will ensure that it's automatically required when your app starts, but some people expect that classes in app/models are backed by ActiveRecord.

You could also put it under lib/ if you prefer."



'via Blog this'

Ruby/Rails - How to Create a Class and Access it from the Controller - Stack Overflow

Ruby/Rails - How to Create a Class and Access it from the Controller - Stack Overflow: "You should put location.rb wherever you feel it makes the most sense. Having it at app/models/location.rb will ensure that it's automatically required when your app starts, but some people expect that classes in app/models are backed by ActiveRecord.

You could also put it under lib/ if you prefer."



'via Blog this'

How to resize photos for the web using GIMP (free image editing software from gimp.org) - YouTube

How to resize photos for the web using GIMP (free image editing software from gimp.org) - YouTube: "This video specifically talks about resizing photos for Facebook."



'via Blog this'

git push heroku master Permission denied (publickey). fatal: The remote end hung up unexpectedly - Stack Overflow

git push heroku master Permission denied (publickey). fatal: The remote end hung up unexpectedly - Stack Overflow: "heroku keys:add ~/.ssh/id_rsa.pub"

fixed my problem with "git push heroku master"



'via Blog this'

SSH/OpenSSH/Keys - Community Help Wiki

SSH/OpenSSH/Keys - Community Help Wiki: "sudo service ssh restart"



'via Blog this'

[all variants] ssh unrecognized service

[all variants] ssh unrecognized service: "dpkg -l | grep ssh"



'via Blog this'

Generating SSH Keys · GitHub Help

Generating SSH Keys · GitHub Help: "Check the directory listing to see if you have a file named either id_rsa.pub or id_dsa.pub. If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3."



'via Blog this'

Saturday, February 15, 2014

Rails with Git and GitHub · RailsApps

Rails with Git and GitHub · RailsApps: "Rails with Git and GitHub
by Daniel Kehoe
Last updated 4 September 2013

Using Git and GitHub with Rails. Git provides a source control repository. Use Git to roll back code changes as needed, when you are collaborating with others, and when you must deploy an app for hosting with a service such as Heroku. Get a GitHub account for remote backup and collaboration.

If you are building a throw-away app for your own education, you may decide not to use Git, but sooner or later you will need to learn to use Git to participate in the open source community. Git is not easy to understand or learn (see a discussion) but it is a worthwhile and essential tool for software development."



'via Blog this'

Setting up Sublime Text 3 for Rails Development | The K Unit

Setting up Sublime Text 3 for Rails Development | The K Unit: "When I started programming, IDEs were the norm. I spent much of my time using tools like Microsoft Visual Studio and got very used to features like Autocomplete. However, that also meant I needed to have access to MSDN which for a young professional was very expensive if you wanted to develop on your own dime and time. IDEs also tend to be very prescriptive and require a lot of overhead"



'via Blog this'

Setting up Sublime Text for Ruby development -

Setting up Sublime Text for Ruby development -: "Here are the steps I usually follow to take a new ST3 install from good to awesome:

Install the subl command line tool. Assuming ~/bin is in your path:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl"



'via Blog this'

How To Install Sublime Text 3 in Ubuntu 13.04, 13.10 | Unixmen

How To Install Sublime Text 3 in Ubuntu 13.04, 13.10 | Unixmen: "sudo add-apt-repository ppa:webupd8team/sublime-text-3
$ sudo apt-get update
$ sudo apt-get install sublime-text-installer"



'via Blog this'

How to add a network printer (HL2270DW) in UBUNTU 11.10 - YouTube

How to add a network printer (HL2270DW) in UBUNTU 11.10 - YouTube:

This is how I finally got my brother hl2270dw installed on my ubuntu



the exact driver is tricky to get to, select HL-2275DW :



http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html#HL-2270DW



to get close to the driver you want, then scroll up and down until you find your exact driver.



follow the instructions in the video and you are home free.



'via Blog this'

Install Ruby on Rails · Ubuntu Linux · RailsApps

Install Ruby on Rails · Ubuntu Linux · RailsApps: "Don’t Install Ruby from a Package
Ubuntu provides a package manager system for installing system software. You’ll use this to prepare your computer before installing Ruby. However, don’t use apt-get to install Ruby. The package manager will install an outdated version of Ruby. And it will install Ruby at the system level (for all users). It’s better to use RVM to install Ruby within your user environment."



'via Blog this'

Ubuntu Linux: Install Google Chrome Browser Command

Ubuntu Linux: Install Google Chrome Browser Command:



'via Blog this'

Sunday, February 9, 2014

readability - How to determine if a programming language is verbose or terse? - Programmers Stack Exchange

readability - How to determine if a programming language is verbose or terse? - Programmers Stack Exchange: "Verbose means lots of symbols. Terse means fewer symbols.

This has nothing to do with ease of reading or ease of understanding.

Some folks find verbose COBOL easy to read, other find it confusing because so many symbols are required to do so little.

Some folks find terse I/J/K and APL easy to read because the program is very short. Others find it hard to read because the symbols are obscure.

Terse/Verbose has no relationship with easy to read or easy to understand."



'via Blog this'

What Does & Mean? | FSDeveloper

What Does &amp; Mean? | FSDeveloper: "While Ron is "technically correct," I'm assuming that you simply wanted to know the following:

& is just the "full way" of writing the "&" symbol...

...just like &gt: is the "full way" of writing ">"...

(Hint: the symbol is called an "ampersand" or "amp" for short!)

In FS XML syntax, it is used like this:

&& is the same as &&amp is the same as and

I just explained this in another post about a week ago... "



'via Blog this'