Skip to content

Instantly share code, notes, and snippets.

View waldothedeveloper's full-sized avatar
🎖️
Never give up!

Waldo Lavaut waldothedeveloper

🎖️
Never give up!
View GitHub Profile
@waldothedeveloper
waldothedeveloper / AWSLambdaSimpleSMS.js
Created February 21, 2020 21:03 — forked from stevebowman/AWSLambdaSimpleSMS.js
AWS Lambda Function to send an SMS message via the Twilio API
View AWSLambdaSimpleSMS.js
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
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')
View gist:d08320a8033327c33dcf9764ada688b3

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.

@waldothedeveloper
waldothedeveloper / filters.markdown
Created August 10, 2017 20:38 — forked from jcasimir/filters.markdown
Controller Filters
View filters.markdown

Controller Filters

The Rails REST implementation dictates the default seven actions for your controllers, but frequently we want to share functionality across multiple actions or even across controllers. Controller filters are the easiest way to do that.

Before, After, and Around

There are three types of filters implemented in Rails:

  • a before_filter runs before the controller action
  • an after_filter runs after the controller action
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Gmail</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<main>