Skip to content

Instantly share code, notes, and snippets.

View stephaniewilkinson's full-sized avatar
🐧

Stephanie Wilkinson stephaniewilkinson

🐧
View GitHub Profile
HTTP.basic_auth(auth).persistent(BOOKMOOCH_URI) do |http|
if isbns_and_image_urls
def post_to_bookmooch(isbn, image_url,title)
...
end
pool = ConnectionPool.new(size: 5, timeout: 5) do
HTTP.persistent("https://bookmooch.com/....")
end

To create:

git tag c1b3c4601b72a64741bfea3b2fe9a4166ddf6600 -a v1.1 -m "Upgraded to Rails 5.0"
git push --tags

To delete:

git tag -d v1.1
git push origin :refs/tags/v1.1
school.school_surveys.each do |survey|
survey.standards.each do |standard|
standard.questions.each do |question|
question.answers.each do
if question.rating?
question.answers.each do |answer|
if answer.school_survey_id = survey.id
answer_array.push answer
else
answer_array.push "Not Applicable"

Popular Options for Shells:

  1. Bash
  2. Fish
  3. Zsh

Bash (Bourne Again SHell) is the default shell on your mac. You use it when you open Terminal and execute commands. It has two associated files for customization, .bash_profile and .bashrc

``
$ brew services start postgresql
Service `postgresql` already started, use `brew services restart postgresql` to restart.
$ rake
/Users/steph/.gem/ruby/2.2.2/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize': could not connect to server: No such file or directory (PG::ConnectionBad)
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
$ brew services restart postgresql
Stopping `postgresql`... (might take a while)
Switch What it does Example
-e executes the subsequent code ruby -e 'puts "te quiero"'
-w gives you any warning messages that your program might generate ruby -we 'if 9; puts "te quiero" end'
-c checks your syntax Syntax OK
-rprofile requires the feature, prefaced with r ruby -rpry filename.rb

Keybase proof

I hereby claim:

  • I am stephaniewilkinson on github.
  • I am whathappens (https://keybase.io/whathappens) on keybase.
  • I have a public key whose fingerprint is CDC1 7330 25E1 7F7F 5A36 E85F 64FA 2658 818F 3A81

To claim this, I am signing this object:

http://localhost:3000/reset?=
token=3DeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImVtYWlsIjoiYWRtaW=
4iLCJwYXNzd29yZCI6ImFkbWluIn0sImlhdCI6MTQ2ODQ0MDUwMCwiZXhwIjoxNDY4NDUwNTAwf=
Q.LRIdC4oMHGcxr9NupLFGQGY4a5jhLtnh8t9hTEd1yhw
DEBUG=app:* nodemon
require 'minitest/autorun'
require 'minitest/pride'
require 'since_potter'
describe SincePotter do
before do
@since_potter = SincePotter.new
end
describe "the truth" do