Skip to content

Instantly share code, notes, and snippets.

View caioertai's full-sized avatar
🔮
Klatchian Coffee Guzzler

Caio Andrade caioertai

🔮
Klatchian Coffee Guzzler
  • Mexico City
View GitHub Profile

Differences between p and puts in Ruby

In short

p

Prints an inspected version of the argument AND returns the argument.

[1] pry(main)> name = p [["Hello"]]

Going deeper into Ruby and Rails in the post-Wagon blues

by Caio Andrade Le Wagon Teacher and Klatchian Coffee Guzzler

About this list

This list is ultimately a reflection of my own experiences growing as a developer. It’s more suitable if your career goal is to be a Ruby developer with a heavy focus on Software Engineering and the Rails stack. It deepens what you're familiar with after finishing Le Wagon.

The golden advice

Build things. If you're practicing by yourself, find a problem you want to solve. Be it a page component you're interested in (a navbar that hides on a threshold) or an entire, but simple, app (a downscaled Evernote clone), it's important to have clear goals and to be able to see the results of your work.

Courses

@jkotchoff
jkotchoff / generate_twitter_bearer_token.rb
Last active April 27, 2023 23:10
Send Tweets to the Twitter API with an OAuth1 token
# Generate and use an oauth2 bearer token for the Twitter API in Ruby
#
# For Application-Only authentication to the twitter API, a 'bearer token'
# is required to authenticate agains their endpoints for rate limiting
# purposes.
#
# This script generates a bearer token by posting to twitter and then it
# uses that token to poll their API.
#
# Note, the base 64 encoded consumer credentials for the bearer token needs
@panmari
panmari / postgresql_random_retrieve.rb
Last active May 11, 2018 10:59
Benchmark of various methods to retrieve a random record from a table using ActiveRecord and a Postgresql db behind.
require 'benchmark'
# Disable logging if in development/test mode
ActiveRecord::Base.logger = nil
model_name = Icd
N = 100
Benchmark.bm(11) do |x|
x.report('ruby rand') { N.times { model_name.offset(rand(model_name.count)).first } }