Skip to content

Instantly share code, notes, and snippets.

View joeybeninghove's full-sized avatar

Joey Beninghove joeybeninghove

View GitHub Profile

Keybase proof

I hereby claim:

  • I am joeybeninghove on github.
  • I am joeybeninghove (https://keybase.io/joeybeninghove) on keybase.
  • I have a public key ASBdYH3-nFNSqHKVs7DrM5uCmMR7jaz4BcdPKrendX4Lcgo

To claim this, I am signing this object:

@joeybeninghove
joeybeninghove / .postcssrc.yml
Created February 15, 2018 02:21
Tailwind with Rails and Webpacker
plugins:
postcss-import: {}
postcss-cssnext: {}
tailwindcss: "./app/javascript/src/tailwind.js"
@joeybeninghove
joeybeninghove / outline.css
Created February 14, 2018 18:33
Little helper class to help with debugging CSS layout issues
body.debug * {
outline: 1px solid red !important;
}
@joeybeninghove
joeybeninghove / .irbrc
Created February 14, 2018 16:08
Retain history of commands for IRB and Rails console sessions
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
@joeybeninghove
joeybeninghove / .irbrc
Created February 14, 2018 02:06
Helper to show just the methods that matter for a Ruby object
class Object
def interesting_methods
case self.class
when Class
self.public_methods.sort - Object.public_methods
when Module
self.public_methods.sort - Module.public_methods
else
self.public_methods.sort - Object.new.public_methods
end
@joeybeninghove
joeybeninghove / application.html.erb
Created February 9, 2018 03:58
app/views/layouts/application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>App</title>
<%= csrf_meta_tags %>
<%= stylesheet_pack_tag "application", media: "all", "data-turbolinks-track": "reload" %>
<%= javascript_pack_tag "application", "data-turbolinks-track": "reload" %>
</head>
@joeybeninghove
joeybeninghove / environment.js
Created February 9, 2018 03:57
config/webpack/environment.js
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
environment.plugins.prepend(
'Provide',
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
jquery: 'jquery'
})
@joeybeninghove
joeybeninghove / content_security_policy.rb
Created February 9, 2018 03:57
config/initializers/content_security_policy.rb
# Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Rails.application.config.content_security_policy do |p|
p.default_src :self, :https
p.font_src :self, :https, :data
p.img_src :self, :https, :data
p.object_src :none
p.script_src :self, :https
@joeybeninghove
joeybeninghove / .postcssrc.yml
Created February 9, 2018 03:56
.postcssrc.yml
plugins:
postcss-import: {}
postcss-cssnext: {}
tailwindcss: "./app/javascript/src/tailwind.js"
@joeybeninghove
joeybeninghove / application.css
Created February 9, 2018 03:56
app/javascript/src/application.css
@tailwind preflight;
@tailwind utilities;