- Rails 7.0.2
- stimulus js
- importmaps
- dropzone.js
- direct upload ActiveStorage
This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.
This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.
# frozen_string_literal: true | |
module Aws | |
# Client for AWS Cognito Identity Provider using Secure Remote Password (SRP). | |
# | |
# This code is a direct translation of the Python version found here: | |
# https://github.com/capless/warrant/blob/ff2e4793d8479e770f2461ef7cbc0c15ee784395/warrant/aws_srp.py | |
class CognitoSrp | |
def initialize(username:, password:, pool_id:, client_id:, aws_client:) | |
@username = username |
########################### | |
## Configuration | |
############################ | |
# | |
# use 256 term for pretty colors | |
set -g default-terminal "screen-256color" | |
# increase scroll-back history | |
set -g history-limit 5000 |
This is a full-day workshop on architecting state management in Vue. In this workshop, you will learn why you should use Vuex in your Vue application. Through hands-on exercises, you will learn the basics of Vuex like state, actions, mutations, and getters. We will also cover using named modules as well as best practices. If time permits, we may even dive into the new composition api and how we can harness it for state management!
https://github.com/shortdiv/vuex-workshop
Make sure you can create a new boilerplate Vue application using Vue CLI.
class Models | |
def self.generate what = :model | |
Rails.application.eager_load! | |
ActiveRecord::Base.descendants.each do |model| | |
method(what)[model] | |
end | |
true | |
end | |
def self.factory model | |
factory_file_name = "spec/factories/#{model.name.underscore}.rb" |
# USAGE: Hash.from_xml(YOUR_XML_STRING)require 'rubygems' | |
require 'nokogiri' | |
# modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#123129 | |
7 | |
class Hash | |
class << self | |
def from_xml(xml_io) | |
begin | |
result = Nokogiri::XML(xml_io) |