Skip to content

Instantly share code, notes, and snippets.

Avatar

maebeale

  • RTP/Ithaca/Glens Falls/Traverse City/DC
View GitHub Profile
View rails_vs_sql.rb
# 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?
@maebeale
maebeale / battleship.md
Last active Aug 29, 2015
battleship game
View battleship.md
View mae.profile
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
@maebeale
maebeale / rakefile-refactor-draft
Created Jul 15, 2014
rakefile refactor draft
View rakefile-refactor-draft
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'
View rake-importer-notes
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