Skip to content

Instantly share code, notes, and snippets.

🐢
Building the next thing

Shane Becker veganstraightedge

🐢
Building the next thing
Block or report user

Report or block veganstraightedge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@veganstraightedge
veganstraightedge / _opinions.md
Last active Jun 29, 2019
StandardRB and I think different things are better. ¯\_(ツ)_/¯
View _opinions.md

TO MY EYES, the first is worse than the second.

@veganstraightedge
veganstraightedge / rails__credentials_edit__error.txt
Created Mar 2, 2019
In a fresh Rails 5.2 app, `rails credentials:edit` works as advertised. In my Rails 5.2 app, something has been changed and `rails credentials:edit` doesn't work. It gives the error below. I can't find what change caused this.
View rails__credentials_edit__error.txt
activesupport-5.2.2/lib/active_support/message_encryptor.rb:206:
in `rescue in _decrypt':
ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)
1: from activesupport-5.2.2/lib/active_support/message_encryptor.rb:183:in `_decrypt'
2: from activesupport-5.2.2/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
3: from activesupport-5.2.2/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
4: from activesupport-5.2.2/lib/active_support/encrypted_file.rb:79:in `decrypt'
5: from activesupport-5.2.2/lib/active_support/encrypted_file.rb:42:in `read'
6: from activesupport-5.2.2/lib/active_support/encrypted_configuration.rb:21:in `read'
View middleman4_with_sassc.err
WARN: Unresolved specs during Gem::Specification.reset:
rack (< 3, >= 1.4.5)
parallel (>= 0)
activesupport (< 5.1, >= 3.1, >= 4.2)
addressable (~> 2.3)
rb-inotify (>= 0.9.7, ~> 0.9)
concurrent-ruby (~> 1.0)
fastimage (~> 2.0)
rake (>= 0)
hashie (~> 3.4)
View heroku_pg_pull_errror
[...]
pg_restore: creating MATERIALIZED VIEW DATA "public.search_results"
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 3476; 0 483995421 MATERIALIZED VIEW DATA search_results uc4reedsrss2pi
pg_restore: [archiver (db)] could not execute query: ERROR: lexeme array may not contain nulls
Command was: REFRESH MATERIALIZED VIEW public.search_results;
View deprecation_warning.txt
DEPRECATION WARNING: Static attributes will be removed in FactoryBot 5.0. Please use dynamic
attributes instead by wrapping the attribute value in a block:
alias { "orders" }
To automatically update from static attributes to dynamic ones,
install rubocop-rspec and run:
rubocop --require rubocop-rspec \
--only FactoryBot/AttributeDefinedStatically \
View longest_common_subsequence.rb
#!/usr/bin/env ruby
if ARGV.length != 2
puts
puts 'ERROR! This script needs exactly two strings as input. Example: '
puts
puts ' ruby subsequence.rb XMJYAUZ MZJAWXU'
puts
exit -1
end
View longest_common_subsequence.rb
#!/usr/bin/env ruby
if ARGV.length != 2
puts
puts 'ERROR! This script needs exactly two strings as input. Example: '
puts
puts ' ruby subsequence.rb XMJYAUZ MZJAWXU'
puts
exit -1
end
@veganstraightedge
veganstraightedge / bootstrap.sh
Last active Aug 30, 2018
These lines of commands work when run directly in Terminal, but fail when run as the contents of a file.
View bootstrap.sh
#!/bin/sh
# this test case script assumes that you are on macOS and have Homebrew (brew) installed
set -e
brew install nvm
mkdir -p ~/.nvm
export NVM_DIR="$HOME/.nvm"
View help_me.please
```
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/s/.gem/ruby/2.5.1/gems/rmagick-2.16.0/ext/RMagick
/Users/s/.rubies/ruby-2.5.1/bin/ruby -r ./siteconf20180624-31720-1jgmacc.rb extconf.rb
checking for clang... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
View promises.rb
promises = []
# Create the collection of promises to do
(1..10).each do |i|
promises << Concurrent::Promise.execute do
thing = get the thing from the API
Thing.create! name: thing.name
end
end
You can’t perform that action at this time.