List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
<?php defined('ABSPATH') or die(); | |
/* | |
* Plugin Name: Bad Matt | |
* Plugin URI: https://gschoppe.com | |
* Description: A protest plugin that removes (or replaces via filter) the Automattic-owned woocommerce stripe gateway partner id. | |
* Version: 1.0.0 | |
* Requires at least: 4.0 | |
* Requires PHP: 7.2 | |
* Author: Greg Schoppe | |
* Author URI: https://gschoppe.com/ |
# This is a thin wrapper of the Simple Form builder. It delegates rendering the resulting form fields to Simple Form | |
# but typically amends the Tailwind classes of the various elements in the field layout. It tightly integrates with the | |
# unstyled wrapper (aka `:plain`) Simple Form configuration (see `simple_form.rb`). The methods support the same syntax | |
# as the original Simple Form methods but enhance it to support replacing defaylt Tailwind claseses. | |
class Builders::TailwindFormBuilder < SimpleForm::FormBuilder | |
# This is the basic method for rendering `<input>` tags and their variants. | |
def input(attribute_name, options = {}, &block) | |
# The default Tailwind classes for the various parts of the Simple Form wrapper layout. | |
input_class = "block w-full sm:text-sm ... #{'text-gray-500 bg-gray-50' if options.dig(:input_html, :disabled)}" |
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
# /spec/support/mock_geocoder.rb | |
# Used with ffaker | |
RSpec.configure do |c| | |
class MockResult < ::Geocoder::Result::Base | |
def initialize(data = []) | |
super(data) | |
end | |
end |
Afghanistan | |
Albania | |
Algeria | |
Andorra | |
Angola | |
Antigua & Deps | |
Argentina | |
Armenia | |
Australia | |
Austria |
Look like brew libxml2 and the one bundled with osx are fighting | |
/Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle: dlsym(0x7ffb44ee7880, Init_libxml_ruby): symbol not found - /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle (LoadError) | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/libxml-ruby-1.1.4/lib/libxml.rb:9 | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require' | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require' | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each' | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `require' | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each' | |
from /Users/unixcharles/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.0.1 |