Skip to content

Instantly share code, notes, and snippets.

View urieljuliatti's full-sized avatar
🏠
Working from home

Uriel Juliatti urieljuliatti

🏠
Working from home
View GitHub Profile
@peimelo
peimelo / History|-10f5620e|entries.json
Last active February 12, 2023 20:38
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/melo/Projects/Angular/controlled-health-frontend/src/app/exams/services/exams-facade.service.ts","entries":[{"id":"qela.ts","timestamp":1650461783059},{"id":"1DVY.ts","timestamp":1650462325935},{"id":"mUEH.ts","timestamp":1650462392089},{"id":"FCQI.ts","timestamp":1650463035177}]}
@kirillshevch
kirillshevch / rails_new_options_help.md
Last active April 8, 2024 15:24
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)

It can be difficult to test the different scenarious for a module intended for use by including in another class.

If the class is statically defined in the spec, any later definitions extend, not replace, the first definition - which can cause test issues and breaks isolation between examples.

RSpec.describe SomeModule do
  class SomeIncluder
    include SomeModule
  end
 
module AuthRequestHelper
def http_auth_as(username, password, &block)
@env = {} unless @env
old_auth = @env['HTTP_AUTHORIZATION']
@env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(username, password)
yield block
@env['HTTP_AUTHORIZATION'] = old_auth
end
def auth_get(url, params={}, env={})
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'activerecord', '4.2.1'
gem 'state_machines'
gem 'sqlite3'
gem 'minitest'
GEMFILE
system 'bundle'
@JunichiIto
JunichiIto / alias_matchers.md
Last active April 11, 2024 18:42
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@m3nd3s
m3nd3s / helper.rb
Created November 13, 2013 13:33
Helper do Mendes
#encoding: utf-8
module M3nd3s
def me_ajuda!
"NÃO"
end
end
@adamdb
adamdb / NERDTree Commands
Last active July 11, 2023 11:52
A list of useful NERDTree commands.
Use the natural Vim navigation keys hjkl to navigate the files.
Press o to open the file in a new buffer or open/close directory.
Press t to open the file in a new tab.
Press i to open the file in a new horizontal split.
Press s to open the file in a new vertical split.
Press p to go to parent directory.
Press r to refresh the current directory.
Press m to launch NERDTree menu inside Vim.
@wicz
wicz / bootstrap.sh
Created April 9, 2013 13:28
Configuration files and scripts for the blog post: Faster Rails 3 deployments to AWS Elastic Beanstalk http://horewi.cz/faster-rails-3-deployments-to-aws-elastic-beanstalk.html
#!/usr/bin/env bash
mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache
ln -s /var/app/support/bundle /var/app/ondeck/vendor
ln -s /var/app/support/assets /var/app/ondeck/public
ln -s /var/app/support/cache /var/app/ondeck/vendor
sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu