Skip to content

Instantly share code, notes, and snippets.

View plicjo's full-sized avatar

Joshua Plicque plicjo

View GitHub Profile
plicjo / simple_s3_upload.ex
Last active August 30, 2023 23:16
LiveView Uploads to S3
View simple_s3_upload.ex
defmodule SimpleS3Upload do
@moduledoc """
Dependency-free S3 Form Upload using HTTP POST sigv4
@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"
plicjo / gist:3d55ec964d98941e87d299ed6e0a7d78
Created July 7, 2023 17:55
Wallaby commands for upgrading Chromedriver
View gist:3d55ec964d98941e87d299ed6e0a7d78
brew tap homebrew/cask
brew install --cask chromedriver
xattr -d $(which chromedriver)
View React and Rails projections
"app/javascript/components/*.js": {
"command": "component"
"app/javascript/reducers/*.js": {
"command": "reducer"
"app/javascript/actions/*.js": {
"command": "actions"
View .rubocop.yml
inherit_from: .rubocop_todo.yml
- rubocop-performance
- rubocop-rails
- rubocop-rspec
TargetRubyVersion: 2.6
View HookExample.js
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
module Boxr
def self.downscope_token_for_box_ui_element(token, folder_id) 'bar')
def self.refresh_tokens(refresh_token, options = {}) 'new_token', refresh_token: 'new_refresh_token')
class Client
plicjo / .zshrc
Created September 18, 2019 21:57
View .zshrc
source ~/hcd
plicjo /
Last active September 7, 2017 18:34
Install Firebird on CI
#!/usr/bin/env bash
tar -zxvf FirebirdSS-
cd FirebirdSS-
plicjo / general ledger decorator
Last active June 28, 2017 15:04
GSAF General Ledger
View general ledger decorator
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)
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
plicjo / tests_acceptance_foo-test.js
Created September 7, 2016 03:12 — forked from code0100fun/tests_acceptance_foo-test.js
Ember CLI QUnit text content helpers
View tests_acceptance_foo-test.js
// 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">]