Skip to content

Instantly share code, notes, and snippets.

FROM codeship/ruby
MAINTAINER Dave Mox <dave.e.mox@gmail.com>
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
vim
COPY Makefile /src/
#!/usr/bin/env ruby
require 'aws-sdk'
# initialize S3 client
s3_client = Aws::S3::Client.new(region: 'us-east-1')
# initialize KMS client
kms_client = Aws::KMS::Client.new(region: 'us-east-1')

Keybase proof

I hereby claim:

  • I am themoxman on github.
  • I am davemox (https://keybase.io/davemox) on keybase.
  • I have a public key ASAD-sH241NWoAtdF-nTTv79YQz4NHV5Tk3u2cktHwlU0Ao

To claim this, I am signing this object:

Availability of set_user

Think I'm missing something obvious here, but why is set_user available to be called wherever I want in CollectionsController?

2.0.0p353 :009 > class Test
2.0.0p353 :010?>   def self.method1
2.0.0p353 :011?>     method2
2.0.0p353 :012?>     end
2.0.0p353 :013?>   def method2

####Form submits to TagsController#destroy

Whenever I add the Foundation button-group to my form, the 'Save Changes' submit button requests TagsController#destroy instead of #update.

= simple_form_for @tag do |f|
  = f.input :name, label: false
  = f.button :submit, "Save Changes", class: 'button'
= link_to 'Back to Tags', tags_path, class: 'button'
= button_to 'Delete Tag', tag_path(@tag), :method =&gt; :delete, data: { confirm: 'Delete Tag?' }, class: 'button' 

####Zurb Foundation See this article. Good discussion of Foundation vs Bootstrap. Thought this was a great overview of responsive design.

####Mobile emulator Any tools you use to mimic different screen sizes? Mobile and tablet.

~/Desktop/coding_resources/programs/md_notes
12:17:05 davemox@Daves-MacBook-Pro $ bundle exec rspec
..F..................................F...
Failures:
1) Add a new note create a note and create tags
Failure/Error: expect(page).to have_content "Postgres DB"
expected to find text "Postgres DB" in "Note created Tags Search Rails Ruby Postgres Rails, DB, Query"
# ./spec/features/note_spec.rb:42:in `block (2 levels) in <top (required)>'
= link_to "Tags", tags_path
= link_to "Search", new_search_path
= simple_form_for @note do |f|
= f.input :title, label: false, placeholder: "note title"
= f.input :content, label: false, placeholder: "note content"
#tags
- @tag_list.each do |tag|
= button_tag "#{tag.name}", data: tag.id
#new_tags
= text_field_tag 'new_tags', nil, placeholder: "Add additional comma separated tags here"

####Strange Test Behavior

With no apparent order, the test will sometimes pass and sometimes not pass.

~/Desktop/coding_resources/programs/md_notes
23:36:02 davemox@Daves-MacBook-Pro $ bundle exec rspec
.........................................

Finished in 6.33 seconds

###Including JS in search.js or application.js

jQuery works when inline in the view file, but not when added to the javascripts/ directory.

$(this) vs event objects

What's the difference.