Skip to content

Instantly share code, notes, and snippets.

Ricardo Alarcon geocodinglife

View GitHub Profile
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@geocodinglife
geocodinglife / postgres-cheatsheet.md
Created Feb 10, 2019 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@geocodinglife
geocodinglife / my_mailer.rb
Created Jan 18, 2019 — forked from Nosfheratu/my_mailer.rb
send pdf attachment
View my_mailer.rb
class MyMailer < ApplicationMailer
def send_invoice user, invoice
@user = user
@invoice = invoice
invoice_attachment = WickedPdf.new.pdf_from_string(render_to_string(pdf: "invoice", template: 'payments/charges/invoice.pdf.erb'))
attachments["I#{sprintf('%06d', @invoice.id)}.pdf"] = invoice_attachment
mail(to: @user.email,
subject: "Your invoice", template_path: 'users_mailer')
end
end
@geocodinglife
geocodinglife / 42-things.md
Created Oct 23, 2018 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do
View 42-things.md
View node-folder-structure-options.md

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@geocodinglife
geocodinglife / gist:da836aad863b23b38dddabe03de5e64d
Created Nov 24, 2017 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:da836aad863b23b38dddabe03de5e64d

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@geocodinglife
geocodinglife / GitHub-Forking.md
Created Oct 25, 2017 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow
View GitHub-Forking.md

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@geocodinglife
geocodinglife / syntax.md
Created Sep 10, 2017 — forked from wearethefoos/syntax.md
Ruby vs JS vs ES6
View syntax.md

Variables

Ruby

Name a value.

color = "red"
@geocodinglife
geocodinglife / node-folder-structure-options.md
Created Aug 25, 2017 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?
View node-folder-structure-options.md

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
You can’t perform that action at this time.