Skip to content

Instantly share code, notes, and snippets.

View dedemenezes's full-sized avatar

André Menezes dedemenezes

View GitHub Profile
@trouni
trouni / stimulusjs_cheatsheet.md
Last active November 20, 2023 13:14
Stimulus.js Cheatsheet

Cheat Sheet: Using Stimulus.js in Rails

Create and Connect a Stimulus Controller

  1. Create a new Stimulus controller file, either:
  • with rails g stimulus my_feature, or
  • by manually adding a file in the controllers directory of your Rails application, e.g., app/javascript/controllers/my_feature_controller.js.
  1. The controller file should define your Stimulus controller class:

Installing the Broadcom wireless drivers on a Mac in Ubuntu, Debian, and Debian derivatives

#linux #mac #broadcom #hardware


⚠️ Although this procedure has been tested on a MacBook Air 6,2, it may vary depending on your hardware. If you have a different device or if your process differs from the instructions below, please leave a comment so that I can update this guide accordingly.

Before following the instructions below, make sure your machine is connected to a network. If your machine doesn't have an Ethernet adapter, you can use your phone's hotspot via USB.

@dedemenezes
dedemenezes / index.html
Created April 5, 2022 22:57
Dom & Events Lecture
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<title>Playground - JavaScript 101</title>
</head>
<body>
@trouni
trouni / rails_partials_tips.md
Last active November 20, 2023 13:17
Rails Partials Tips

Rails Partials Pro Tips

Best practices to keep you Rails views tidy and your components smart.

Pro Tip #1 💡 When should you use a partial?

Think in terms of component. Can those few lines be reused somewhere else in your application? If the answer is yes, it should be in a partial.

@mynameispj
mynameispj / application_helper.rb
Created June 2, 2013 00:24
Rails - Easy "active" classes for menu links in Rails
module ApplicationHelper
def current_class?(test_path)
return 'active' if request.path == test_path
''
end
end
@ryansobol
ryansobol / gist:5252653
Last active February 23, 2025 06:28
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@amejiarosario
amejiarosario / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@mislav
mislav / pagination.md
Created October 12, 2010 17:20
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o