Skip to content

Instantly share code, notes, and snippets.

View hutch78's full-sized avatar

Jeremy Hutchcraft hutch78

View GitHub Profile
@hutch78
hutch78 / ShipmentManager.vue
Created March 29, 2022 01:07
Vue 3 \ Typescript \ Vuelidate Errors
<script lang="ts" setup>
const state = reactive<ShipmentManagerState>({
shipmentDetailsSubmitLoading: false,
readOnly: false,
booking: null,
cargoForm: {
params: {
cargo_year: '',
cargo_make: '',
/**
* Set CSS variables for each property in the passed-in colors object
* @param {object} colors Colors object from the database
*/
updateCSSVariables(colors) {
return new Promise((resolve, reject) => {
try {
if (!colors) {
reject('invalid colors');
return false;
Thanks for checking this out... I did not see anywhere in the docs that I was supposed to include the
Authorization header, but it was not working without it so i figured I would try it.
See below for how I am attaching that (found on stack overflow)
STACK TRACE
[2020-11-13 02:42:32] local.ERROR: The resource owner or authorization server denied the request. {"exception":"[object] (League\\OAuth2\\Server\\Exception\\OAuthServerException(code: 9): The resource owner or authorization server denied the request. at /app/vendor/league/oauth2-server/src/Exception/OAuthServerException.php:223)
[stacktrace]
#0 /app/vendor/league/oauth2-server/src/AuthorizationValidators/BearerTokenValidator.php(73): League\\OAuth2\\Server\\Exception\\OAuthServerException::accessDenied('Access token co...')
@hutch78
hutch78 / open-links-in-new-tab-with-analytics.js
Last active April 6, 2018 16:35
PCOMM - Open links and files in new tab, fire analytics event
@hutch78
hutch78 / Gemfile
Last active January 23, 2018 04:50
I am receiving an OpenSSL error when trying to send HTTP requests throigh my rails app.
source 'https://rubygems.org'
gem 'rails'
gem 'pg'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '~> 3.1.7'
gem 'devise', '~> 3.5.6'
gem 'stripe', git: 'https://github.com/stripe/stripe-ruby'
gem 'rack-cors', require: 'rack/cors'
gem 'has_scope'
@hutch78
hutch78 / user-snippers.json
Created January 16, 2018 03:56
VSCODE - User Snippets
{
/*
// Place your snippets for Sass here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@hutch78
hutch78 / user-settings.json
Created January 16, 2018 03:55
VSCODE - User Settings
{
"workbench.iconTheme": "vscode-icons",
"vsicons.projectDetection.autoReload": true,
"window.zoomLevel": 0,
"workbench.startupEditor": "welcomePage",
"editor.minimap.enabled": false,
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
@hutch78
hutch78 / _media-queries.scss
Created September 29, 2017 17:12
Media Query Variables, range functions, etc. Borrowed from Foundation.
// - - - - - - - - - - - - - - - - - - - - - - - - -
// Media Query Ranges
// - usage:
// @media #{$large-up}{
// // styles here
// }
// - - - - - - - - - - - - - - - - - - - - - - - - -
// Tools
@hutch78
hutch78 / _nav-toggle.scss
Created September 29, 2017 17:10
A build-from-scratch hamburger menu. Needs to be cleaned up a bit
/*
Nav Toggle
Markup:
<button class="nav-toggle">
<span class="nav-toggle__icon">
<span class="nav-toggle__line top"></span>
<span class="nav-toggle__line middle"></span>
<span class="nav-toggle__line bottom"></span>
</span>
# Property model
class Property < ActiveRecord::Base
has_and_belongs_to_many :contacts, -> { uniq }
end
# Contact model
class Contact < ActiveRecord::Base
has_and_belongs_to_many :properties, -> { uniq }
end