Skip to content

Instantly share code, notes, and snippets.

View juuh42dias's full-sized avatar
👩‍💻
working from (coworking || café)

Juliana Dias juuh42dias

👩‍💻
working from (coworking || café)
View GitHub Profile
@hudsonmaradona
hudsonmaradona / Script Install Web Server - Ngnix + Unicorn + Ruby 2.0 + PostgreSQL 9.2
Created May 17, 2013 19:32
Script Install Web Server - Ngnix + Unicorn + Ruby 2.0 + PostgreSQL 9.2
#!/bin/bash
# PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Store the base dir
BASEDIR=$( cd $(dirname $0); pwd)
# Get all dependencies

Github Two-Factor Authentication (2FA) for Brazil via SMS

The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55 will be the first on the list, already selected:


🇧🇷 [pt-BR]

Autenticação em dois fatores (2FA) do GitHub para o Brasil via SMS

@serradura
serradura / fp_01.rb
Last active January 17, 2019 14:51
Examples of how Ruby 2.6 is more functional than ever! 👏🎉🚀
raise 'Wrong Ruby version!' unless RUBY_VERSION >= '2.6.0'
module Strings
Trim = -> str { String(str).strip }
Replace = -> (sub, new_sub, str) { String(str).gsub(sub, new_sub) }
LowerCase = -> str { String(str).downcase }
end
# -- Alternative syntax --
Slugify = # Slugify =
@onlurking
onlurking / Ruby and Rails Study Roadmap.md
Created February 25, 2019 23:58
Ruby and Rails Study Roadmap
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active November 20, 2024 08:51
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@thadeu
thadeu / rspec_model_testing_template.rb
Created April 3, 2020 13:33 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@palkan
palkan / bulletify.rb
Created September 7, 2020 17:00
Bulletify: RSpec helpers to run Bullet in tests
RSpec.shared_context "bullet" do
before(:each) do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true # raise an error if N+1 query occurs
Bullet.start_request
end
after(:each) do
Bullet.perform_out_of_channel_notifications if Bullet.notification?
@serradura
serradura / rails_app.rb
Last active July 6, 2022 14:01
Rails + u-authorization
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'pry', '~> 0.13.1'
gem 'rails', '~> 6.0', '>= 6.0.3.4'
gem 'sqlite3', '~> 1.4', '>= 1.4.2'
gem 'u-authorization', '~> 2.3'
end
@luciotbc
luciotbc / sidekiq_hacks.md
Last active February 1, 2023 15:29
sidekiq hacks

Sidekiq

Infra

Parando o sidekiq usando o rails (recomendado)

ps -ef | grep sidekiq | grep busy | grep -v grep | awk '{print $2}' > tmp/sidekiq.pid
cat tmp/sidekiq.pid
bundle exec sidekiqctl stop tmp/sidekiq.pid
@pauloportella
pauloportella / conventional-comments.md
Last active November 4, 2024 20:53
How to setup conventional comments on Github

Conventional comments

Source

You can add all conventional comments Labels to Github as a saved replies by following the following steps:

  1. Go to https://github.com/settings/replies
  2. Open Developer Tools
  3. Copy/Paste above code in JavaScript console
  4. Press enter