AWS S3 now uses JSON for CORS configuration and cors.json
is minimal configuration for Rails 7 direct uploads.
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() | |
{ |
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
## | |
# by SoAwesomeMan | |
str =<<-EOS.gsub(/^[\s\t]*|[\s\t]*\n/, '') # no space "\s" for new line "\n"; kill tabs too | |
select awesome, awesome, awesome, awesome, awesome, awesome, | |
from rad, rad, rad, rad, rad, rad, rad, rad, rad, rad, rad, | |
where cool cool cool cool cool cool cool cool cool cool cool' | |
EOS | |
# => "select awesome, awesome, awesome, awesome, awesome, awesome,from rad, rad, rad, rad, rad, rad, rad, rad, rad, rad, rad,where cool cool cool cool cool cool cool cool cool cool cool'" | |
str =<<-EOS.gsub(/^[\s\t]*/, '').gsub(/[\s\t]*\n/, ' ').strip # yes space "\s" for new line "\n"; kill tabs too |
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| |
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 |
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
# function submit(action, method, values) { | |
# var form = $('<form/>', { | |
# action: action, | |
# method: method | |
# }); | |
# $.each(values, function() { | |
# form.append($('<input/>', { | |
# type: 'hidden', | |
# name: this.name, | |
# value: this.value |
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 |
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 |
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
# UPDATE: Ruby 2.0.0 https://docs.ruby-lang.org/en/2.0.0/Kernel.html#method-i-__dir__ | |
# $ ruby -v | |
# ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18] | |
# $ pwd | |
# /Users/dev/Documents/Github/Gists/awesome/ | |
# $ echo "puts __dir__" > how-to-get-the-directory-of-the-current-file-using-ruby-2-0-0.rb | |
# $ cat how-to-get-the-directory-of-the-current-file-using-ruby-2-0-0.rb | |
# puts __dir__ | |
# $ ruby how-to-get-the-directory-of-the-current-file-using-ruby-2-0-0.rb |
NewerOlder