Skip to content

Instantly share code, notes, and snippets.

View ruby-dev's full-sized avatar

Dustin Ward ruby-dev

  • SSL.com
  • Katy, TX
View GitHub Profile
@ruby-dev
ruby-dev / rails_setup.md
Created November 6, 2022 01:32 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)
@ruby-dev
ruby-dev / Rakefile.rb
Created July 26, 2022 13:28 — forked from drogus/Rakefile.rb
This is the example contents of the Rakefile, which you would use to run active record tasks without using Rails. It assumes using the same directories as rails uses: `db/migrate`, `config/database.yml`.
require 'bundler/setup'
require 'active_record'
include ActiveRecord::Tasks
db_dir = File.expand_path('../db', __FILE__)
config_dir = File.expand_path('../config', __FILE__)
DatabaseTasks.env = ENV['ENV'] || 'development'
@ruby-dev
ruby-dev / rest-api-response-format.md
Created July 22, 2022 17:37 — forked from igorjs/rest-api-response-format.md
REST API response format based on some of the best practices
@ruby-dev
ruby-dev / op-add-identities
Created July 2, 2022 03:03 — forked from eritbh/op-add-identities
1password SSH identity management helpers
#!/bin/bash
echo "Signing into 1password..."
eval $(op signin $@)
items=($(op list items | jq '.[] | select(.templateUuid == "110") | .uuid' --raw-output))
for uuid in "${items[@]}"; do
item_data="$(op get item "$uuid")"
private_key="$(echo "$item_data" | jq '.details.sections[0].fields[] | select(.t == "ssh private key") | .v' --raw-output)"
item_title="$(echo "$item_data" | jq '.overview.title' --raw-output)"
@ruby-dev
ruby-dev / README.md
Created March 20, 2022 15:55 — forked from squizduos/README.md
traefik with Docker Registry and VS Code

traefik

Env:

CONFIGS=/srv/config
EMAIL=squizduos@gmail.com
DOMAIN=sqds.me
RESTARTS=unless-stopped
@ruby-dev
ruby-dev / crud_concern_rails.rb
Created August 24, 2021 18:27 — forked from VishalTaj/crud_concern_rails.rb
CRUD Concern for Rails Controllers
module CrudConcern
extend ActiveSupport::Concern
# Rails version < 5
##################################################################
# This module take cares the CRUD controller methods #
# #
# Note: add skip_before_action if you want to ignore any of the #
# above action to be loaded from module #
##################################################################
### Keybase proof
I hereby claim:
* I am ruby-dev on github.
* I am fyreblock (https://keybase.io/fyreblock) on keybase.
* I have a public key ASCCcM1_ovisDA_MIqYgOIgKYxJeaumPVCSRGbMRoiWklQo
To claim this, I am signing this object: