Here are some things I have learned along the way.
Last Updated: 2013-02-08
Original Audience: Hack Reactor
require 'rspec/core/formatters/documentation_formatter' | |
class TimedFormatter < RSpec::Core::Formatters::DocumentationFormatter | |
def example_passed(example) | |
output.puts "#{passed_output(example)} - #{example.execution_result[:run_time]}" | |
end | |
def example_failed(example) | |
output.puts "#{failure_output(example, example.execution_result[:exception])} - #{example.execution_result[:run_time]}" | |
end |
Here are some things I have learned along the way.
Last Updated: 2013-02-08
Original Audience: Hack Reactor
The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.
First the simplest/core layers, then optional layers depending on which features/functionality you want.
Specs |
|
---|---|
AUTHOR | Ira Herman |
LANGUAGE/STACK | Ruby on Rails Version 4, 5, or 6 |
import { DirectUpload } from 'activestorage' | |
// See DirectUploadController from Rails Active Storage source | |
export class CustomUploader { | |
constructor(input, file) { | |
this.input = input | |
this.file = file | |
this.directUpload = new DirectUpload(this.file, this.url, this) | |
this.dispatch("initialize") | |
} |
# refer to https://ozow.com/integrations/ for more information | |
# Ordering with the params matters, see the link above for more information | |
ozow_params = { | |
'SiteCode': 'SOME_SITE_CODE', # find this here https://dash.ozow.com/MerchantAdmin/Site | |
'CountryCode': 'ZA', # only supports ZA currently | |
'CurrencyCode': 'ZAR', # only supports ZAR currently | |
'Amount': 1000, # this is R1000, not working well for floats though | |
'TransactionReference': 'SOME_TEST', # your internal reference to match against | |
'BankReference': "Nice Reference", # the reference that the customer will see on their bank statement |