Skip to content

Instantly share code, notes, and snippets.

View rmw's full-sized avatar

Rebecca Miller-Webster rmw

View GitHub Profile
@rmw
rmw / main.dart
Created June 17, 2020 18:05 — forked from kauemurakami/main.dart
arquivo principal main
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void main() {
runApp(MyApp());
}
@rmw
rmw / 1_with_tap.rb
Last active August 29, 2015 14:27
Get all combos of strings in 2 arrays
first_names = %w(rebecca jessica mabel)
middle_names = %w(jean lynn orla amelia)
[].tap do |names|
first_names.each do |first_name|
middle_names.each do |middle_name|
names << "#{first_name} #{middle_name}"
end
end
end

Keybase proof

I hereby claim:

  • I am rmw on github.
  • I am rmw (https://keybase.io/rmw) on keybase.
  • I have a public key whose fingerprint is 93F8 E716 E985 14A1 CA7D D466 5F9C 2A6F 2A5E 5F0F

To claim this, I am signing this object:

@rmw
rmw / vim_command
Last active August 5, 2022 17:37
Vim Command (Regex) to convert old Ruby hash syntax to 2.0 syntax
:%s/['":]\([a-zA-Z_-]*\)['"]*\s*=>/\1: /gc
@rmw
rmw / irb.rb
Created October 6, 2014 18:30
Quick & dirty file renaming
Dir["./*"].each_with_index { |f, i| File.rename(f, "nyc-expertise-#{i}.png") }
@rmw
rmw / shell.md
Last active August 29, 2015 14:05
Fix asset issues on Heroku

1. Remove compiled assets from your Github repository

rm -rf public/assets/*
git add -A
git commit -m "Remove compiled assets"

2. Ignore any later compiled assets

Add public/assets/** to your .gitignore file

@rmw
rmw / error.rb
Last active August 29, 2015 14:05
Rspec 3 upgrade - controller error
Failure/Error: get :index
NoMethodError:
undefined method `get' for #<RSpec::ExampleGroups::TodosController::Index:0x007f8a8f981b80>
@rmw
rmw / console.sh
Created August 8, 2014 22:11
Rspec circular ref error for sass
```
rake spec
/Users/rmw/.rbenv/versions/2.0.0-p451/bin/ruby -I/Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.3/lib:/Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-support-3.0.3/lib -S /Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.3/exe/rspec ./spec/models/responses_spec.rb ./spec/models/user_spec.rb
/Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/sass-3.2.19/lib/sass/version.rb:5: warning: loading in progress, circular require considered harmful - /Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/sass-3.2.19/lib/sass.rb
from /Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.3/exe/rspec:4:in `<main>'
from /Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/rmw/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run'
from /Users/rmw/.rbenv/ve

Web App Performance

Back End

N+1

  @users = User.all.includes(:profile) # SELECT * from users

Excessive joins/subselects or exta queries