Skip to content

Instantly share code, notes, and snippets.

View brandoncordell's full-sized avatar

Brandon Cordell brandoncordell

View GitHub Profile
@brandoncordell
brandoncordell / icon_component.rb
Created August 21, 2021 17:05
view_component issue
# frozen_string_literal: true
# app/components/icon/component.rb (using sidecar assets via the view_component-contrib gem)
module Icon
class Component < ApplicationViewComponent
DEFAULT_SIZE = :base
SIZES = %i[xxs xs sm base lg xl xxl].freeze
SIZE_MAPPINGS = {
xxs: 'fa-2xs',
xs: 'fa-xs',
Process: Dungeondraft [6875]
Path: /Applications/Dungeondraft.app/Contents/MacOS/Dungeondraft
Identifier: com.dungeondraft.macos
Version: 1.0.1 (1.0.1.3)
Code Type: X86-64 (Translated)
Parent Process: ??? [1]
Responsible: Dungeondraft [6875]
User ID: 501
Date/Time: 2021-07-05 23:16:01.438 -0400
// app/javascript/packs/application.js
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
// vendor
require('@rails/ujs').start();
require('turbolinks').start();
@brandoncordell
brandoncordell / respond_to.rb
Created December 14, 2017 16:12
respond_to js and json
module Admin
class EcardProgramsController < BaseController
def index
@ecard_programs = EcardProgram.all
end
def create
@ecard_program = EcardProgram.new(ecard_program_params)
respond_to do |format|
#array to check for an actual item location
arr = ["a1","b1","c1","a2", "b2", "c2", "a3", "b3", "c3"]
var = ''
# blank has for locations
locations = {
a1: {},
a2: {},
a3: {},
b1: {},
b2: {},
require 'json'
require 'nokogiri'
require 'open-uri'
require 'pry'
spells = {}
main_page = Nokogiri::HTML(open('https://www.dnd-spells.com/spells'))
spell_rows = main_page.css('#example tr')
spell_row_number = 0
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Starprinter Test</title>
</head>
<body>
<h1>Welcome page</h1>
// http://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
# API key
# Any API key will be required to access the API in production, use the request header
# X-API-KEY: <API Key>
#
# Your API key will be assigned to you from the ATLAS instance
# Filtering data
# You can filter on any field listed under each of the resources
GET /users?filter[lastname]=Smith HTTP/1.1
@brandoncordell
brandoncordell / posting-data.json
Last active July 27, 2016 17:30
Posting Data
POST /filed_documents HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "filed_documents",
"attributes": {
"admin_id": 1,
"cat_1": 0,