based on rules from http://www.hasbro.com/common/instruct/battleship.pdf
- start_game
- grid_value = 8
- computer_squares = an empty hash
# SQL challenge #6 | |
# find authors who have no surveys | |
# In Rails: | |
Survey.where(author_id :1).empty? | |
-OR- | |
a = Author.find(1) | |
a.surveys.empty? | |
a.surveys.any? |
based on rules from http://www.hasbro.com/common/instruct/battleship.pdf
export PS1="\[\e[00;34m\]\w\[\e[0m\]\[\e[00;37m\]\\$ \[\e[0m\]" | |
### HISTORY CONTROL | |
export HISTCONTROL="erasedups" | |
shopt -s histappend | |
export HISTFILESIZE=50000 | |
export HISTSIZE=9999 | |
export HISTIGNORE="&:[ ]*:exit:quit:bg:fg" | |
### GIT PROMPT |
namespace :books do #TODO create cron on heroku for regularly scheduled refreshes of data | |
desc 'Rake task to get books file from web' | |
task :getlivefile => :environment do | |
open('https://raw.githubusercontent.com/vhf/free-programming-books/master/free-programming-books.md', | |
'User-Agent' => 'freeshelf_app') do |free_books| | |
rake books:parsefile #TODO will this line work??? | |
end #TODO ck it out: http://stackoverflow.com/questions/577944/how-to-run-rake-tasks-from-within-rake-tasks | |
end | |
desc 'Rake task to get local books file' |
how to create rake task for importing from md (on web) | |
1. add new *.rake file to lib/tasks folder | |
2. add new task(s) via task method & pass it a block | |
a. add dependencies to show order, like this: | |
task :taskname1 do | |
dsfdfs | |
end | |