Skip to content

Instantly share code, notes, and snippets.

View awesome's full-sized avatar

So Awesome Man awesome

View GitHub Profile
@awesome
awesome / raven-shell
Created November 9, 2023 18:36 — forked from barroco/raven-shell
Send Sentry error from shell using curl
#!/bin/sh
SENTRY_KEY=
SENTRY_SECRET=
SENTRY_PROJECTID=1
SENTRY_HOST=sentry.example.com
SCRIPT_ARGUMENTS=$@
capture_error()
{
@awesome
awesome / 20210313000000_create_foos.rb
Created October 17, 2023 17:54
`citext` pg column format is case insensitive: https://www.postgresql.org/docs/current/citext.html for ruby on rails migration
# 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|
@awesome
awesome / macos-sonoma-ruby-install-ruby-3-1-2.sh
Created September 29, 2023 20:25
ruby-install ruby 3.1.2 FAILED? → FIX 🏥🔧🛠️ ( macOS Sonoma 14.0 / Intel Core i7)
# https://github.com/rbenv/ruby-build/discussions/2245#discussioncomment-7022979
export LDFLAGS="-L/opt/brew/Cellar/[email protected]/1.1.1v/lib"
export CPPFLAGS="-I/opt/brew/Cellar/[email protected]/1.1.1v/include"
export PKG_CONFIG_PATH="/opt/brew/Cellar/[email protected]/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
@awesome
awesome / .gitconfig
Created February 23, 2023 00:06 — forked from joelpittet/.gitconfig
kaleidoscope git mergetool config
# 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
@awesome
awesome / README.md
Created January 13, 2023 22:36 — forked from basti/README.md
AWS S3 CORS configuration for Rails ActiveStorage

AWS S3 now uses JSON for CORS configuration and cors.json is minimal configuration for Rails 7 direct uploads.

@awesome
awesome / load_dotenv.sh
Created January 13, 2023 20:30 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@awesome
awesome / gsub-string-parse-number-with-comma-and-decimal.rb
Created December 5, 2022 23:52
gsub-string-parse-number-with-comma-and-decimal.rb
str = "Czech Republic,CZK,139,000.00"
str.gsub(/[^\d\.,]/, '').gsub(/^,+/,'')
# => "139,000.00"
@awesome
awesome / guide: use puma-dev as proxy.md
Created October 26, 2022 18:32 — forked from rcugut/guide: use puma-dev as proxy.md
guide: use puma-dev as proxy
# 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:
#
@awesome
awesome / gist:b592620313d4ff8712800b40d1e1511b
Created September 15, 2022 19:17 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
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)