View simple_s3_upload.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SimpleS3Upload do | |
@moduledoc """ | |
Dependency-free S3 Form Upload using HTTP POST sigv4 | |
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html | |
""" | |
@doc """ | |
Signs a form upload. | |
The configuration is a map which must contain the following keys: | |
* `:region` - The AWS region, such as "us-east-1" |
View gist:3d55ec964d98941e87d299ed6e0a7d78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew tap homebrew/cask | |
brew install --cask chromedriver | |
xattr -d com.apple.quarantine $(which chromedriver) |
View React and Rails projections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"app/javascript/components/*.js": { | |
"command": "component" | |
}, | |
"app/javascript/reducers/*.js": { | |
"command": "reducer" | |
}, | |
"app/javascript/actions/*.js": { | |
"command": "actions" | |
}, |
View .rubocop.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
inherit_from: .rubocop_todo.yml | |
require: | |
- rubocop-performance | |
- rubocop-rails | |
- rubocop-rspec | |
AllCops: | |
TargetRubyVersion: 2.6 |
View HookExample.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
export default function HookExample() { | |
// State hook | |
const [count, setCount] = useState(0) | |
// Using multiple state hooks | |
// const [age, setAge] = useState(42); | |
// const [fruit, setFruit] = useState('banana'); | |
// const [todo, setTodo] = useState(null)' |
View box_stub.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Boxr | |
def self.downscope_token_for_box_ui_element(token, folder_id) | |
OpenStruct.new(access_token: 'bar') | |
end | |
def self.refresh_tokens(refresh_token, options = {}) | |
OpenStruct.new(access_token: 'new_token', refresh_token: 'new_refresh_token') | |
end | |
class Client |
View .zshrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/hcd |
View firebird.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
wget http://downloads.sourceforge.net/project/firebird/firebird-linux-amd64/2.5-Release/FirebirdSS-2.5.0.26074-0.amd64.tar.gz | |
tar -zxvf FirebirdSS-2.5.0.26074-0.amd64.tar.gz | |
cd FirebirdSS-2.5.0.26074-0.amd64/ | |
./install.sh |
View general ledger decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GeneralLedgerDecorator < LittleDecorator | |
def division_colspan(division) | |
division_members(division).each_with_object([1]) do |member, num_columns| | |
num_columns << 1 if division_member_has_data?(division, member) | |
end.size | |
end | |
def division_member_has_data?(division, member) | |
data = record.get_division_member_data(division, member) | |
(data[:administration_fees].to_f + data[:origination_member_fees].to_f + data[:working_member_fees].to_f) > 0 |
View tests_acceptance_foo-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tests/acceptance/foo-test.js | |
// Assert that text should be found | |
assert.hasText('Not Found'); // Error: Could not find text "Not Found" on the page | |
// Provide custom message | |
assert.hasText('Not Found', 'Expected to find "Not Found"'); // Error: Expected to find "Not Found" | |
// Find any number of elements containing the query text | |
text('Found'); // [<div>Found</div>, <input value="Found">] |
NewerOlder