Env:
CONFIGS=/srv/config
EMAIL=squizduos@gmail.com
DOMAIN=sqds.me
RESTARTS=unless-stopped
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 # | |
################################################################## |
#!/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)" |
REST API response format based on some of the best practices
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' |
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