Skip to content

Instantly share code, notes, and snippets.

View jcmaciel's full-sized avatar
🎯
Focusing

José Carlos Maciel jcmaciel

🎯
Focusing
View GitHub Profile
@AliOsm
AliOsm / .env
Last active February 23, 2025 12:41
Deploy Rails, GoodJob, PostgreSQL, Redis, Memcached, Meilisearch, and ChromaDB on the same server using Kamal.
KAMAL_REGISTRY_PASSWORD=dckr_pat_xXXxx_x0xXxXx-xX-XXX0xX0x-x
RAILS_MASTER_KEY=00x00xxx000xxx000000xx0x000x0x00
POSTGRES_PASSWORD=xXxxx0xXXx0
MEILI_MASTER_KEY=xXxxx0xXXx0
BLAZER_DATABASE_URL=postgres://service:{POSTGRES_PASSWORD}@service-name-postgres:5432/service_production
@rain-1
rain-1 / LLM.md
Last active March 6, 2025 13:08
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@equivalent
equivalent / README.md
Last active February 18, 2025 03:12
Rails 7 importmaps dropzone.js direct upload ActiveStorage

This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.

@kamalptw
kamalptw / Metronic Theme in Rails (Or any other framework)
Last active March 1, 2023 09:01
If you have a Metronic theme and want to use it in rails or any other framework..
Copy tools to root of project
Copy src of your final selected demo to lib/src
Open tools/gulp.config.json
Paste this
{
"config": {
"path": {
"src": "../lib/src"
},
"dist": [
@lazaronixon
lazaronixon / _form.html.erb
Last active February 27, 2025 04:50
Dropzone.js + Stimulus + Active Storage + CSS Zero (2025)
<%= form_with(model: billboard) do |form| %>
<%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %>
<div class="dz-default dz-message flex flex-col items-center">
<%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %>
<h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5>
<p class="text-sm text-subtle">Upload up to 10 files.</p>
</div>
<% end %>
<div class="inline-flex items-center mbs-2 mie-1">
@JakubOboza
JakubOboza / private-docker-regs-with-free-tiers.markdown
Created May 30, 2019 07:15
Private Docker registry with free tiers for Developers.

List of sites with free tier limits

  • Docker Hub - One private repo/image spot for free
  • Three Scale - Very generous free tier 50GB of space, 500 Pulls a month etc..
  • Canister - 20 private repos with almost no limits on free tier
  • Code Fresh - Free tier for developers

Setup your own private registry

@glaucocustodio
glaucocustodio / br_money_type.rb
Last active July 31, 2024 12:05
brazilian currency formating (Ruby on Rails - attributes api)
# app/types/br_money_type.rb
class BrMoneyType < ActiveRecord::Type::Decimal
def cast(value)
value.is_a?(String) ? value.clean_money : value
end
def deserialize(value)
value ? value.to_f : value
end
end
@cdesch
cdesch / rails_generator_cheat_sheet.md
Last active January 31, 2025 17:42
Rails Generator CheatSheet

Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info

Reference

You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.