AWS S3 now uses JSON for CORS configuration and cors.json
is minimal configuration for Rails 7 direct uploads.
View raven-shell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SENTRY_KEY= | |
SENTRY_SECRET= | |
SENTRY_PROJECTID=1 | |
SENTRY_HOST=sentry.example.com | |
SCRIPT_ARGUMENTS=$@ | |
capture_error() | |
{ |
View 20210313000000_create_foos.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# citext pg column format is case insensitive: https://www.postgresql.org/docs/current/citext.html | |
class EnablePostgresExtensions < ActiveRecord::Migration[6.1] | |
def change | |
enable_extension 'citext' | |
end | |
end | |
class CreateFoo < ActiveRecord::Migration[6.1] | |
def change | |
create_table :foos, id: :uuid do |t| |
View macos-sonoma-ruby-install-ruby-3-1-2.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/rbenv/ruby-build/discussions/2245#discussioncomment-7022979 | |
export LDFLAGS="-L/opt/brew/Cellar/openssl@1.1/1.1.1v/lib" | |
export CPPFLAGS="-I/opt/brew/Cellar/openssl@1.1/1.1.1v/include" | |
export PKG_CONFIG_PATH="/opt/brew/Cellar/openssl@1.1/1.1.1v/lib/pkgconfig" | |
ruby-install ruby 3.1.2 | |
# $ sysctl -n machdep.cpu.brand_string | |
# > Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz |
View .gitconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Kaleidoscope.app as difftool and mergetool. | |
[difftool "Kaleidoscope"] | |
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\" | |
[diff] | |
tool = Kaleidoscope | |
[difftool] | |
prompt = false | |
[mergetool "Kaleidoscope"] | |
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot | |
trustExitCode = true |
View README.md
View load_dotenv.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
View gsub-string-parse-number-with-comma-and-decimal.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = "Czech Republic,CZK,139,000.00" | |
str.gsub(/[^\d\.,]/, '').gsub(/^,+/,'') | |
# => "139,000.00" |
View guide: use puma-dev as proxy.md
puma-dev and use as proxy
Guide (macOS) to setupInstall puma-dev as described in the official documentation
brew install puma/puma/puma-dev
# Configure some DNS settings that have to be done as root
View ruby-require-a-local-file-or-gem-in-irb.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# via https://stackoverflow.com/questions/43519292/load-file-from-local-gem-in-irb#46941281 | |
# | |
# If you want to require a local file or gem in irb, I like this method: | |
# | |
# irb -I lib -r usps_countries | |
# This allows you to then require the module in your new irb instance: | |
# | |
# require 'usps_countries' | |
# Options used: | |
# |
View gist:b592620313d4ff8712800b40d1e1511b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options | |
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full. | |
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}… | |
Getting help: | |
-h — print basic options | |
-h long — print more options | |
-h full — print all options (including all format and codec specific options, very long) |
NewerOlder