Skip to content

Instantly share code, notes, and snippets.

Avatar

Dave Sanders DaveSanders

View GitHub Profile
@DaveSanders
DaveSanders / test.svg
Created May 18, 2012
Test SVG for StackOverflow question
View test.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DaveSanders
DaveSanders / gist:5835642
Created Jun 22, 2013
code example for omniauth routes.
View gist:5835642
namespace :api, defaults: {format: 'json'} do
namespace :v1 do
devise_for :users
get '/auth/:provider/callback', to: 'oauth#create'
end
end
@DaveSanders
DaveSanders / gist:8721734
Created Jan 30, 2014
SQL MERGE for Upsert example
View gist:8721734
--- CREATE THE TABLE
USE [Bench]
GO
/****** Object: Table [dbo].[users] Script Date: 1/30/2014 5:42:46 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
@DaveSanders
DaveSanders / Accessibility Resources.txt
Last active Oct 2, 2018
Awesome Accessibility Resources
View Accessibility Resources.txt
List via Brian Rowe, accessibility expert. (brian@therowes.org)
General/Articles
WCAG - https://www.w3.org/WAI/standards-guidelines/wcag/
Smashing Magazine - https://www.smashingmagazine.com/category/accessibility
24 Accessibility - https://www.24a11y.com/
W3C Tutorials - https://www.w3.org/WAI/tutorials/
Deque University - https://dequeuniversity.com/
Inclusive Design 24 - https://inclusivedesign24.org/2018/
@DaveSanders
DaveSanders / sr_rspec_notes.md
Last active Apr 24, 2021
notes for stimulus_reflex + Rspec
View sr_rspec_notes.md

Scenario

I want to use Rspec to build feature specs that test SR pages, just like normal web pages.

Therefore, I expect Capybara + Rspec to be able to do things like:

visit login_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password + 'BAD'
expect(page).to have_content('That email or password is not correct')
@DaveSanders
DaveSanders / client_variables_controller.rb
Last active Sep 28, 2021
Sample Controller Pattern with Turbo
View client_variables_controller.rb
# frozen_string_literal: true
module Tools
class ClientVariablesController < Tools::ToolsController
before_action :set_client_variable, except: [:create]
before_action :set_client
def edit
render turbo_stream: [
turbo_stream.replace('variables-form', partial: 'form')